ReferenceError: FS is not defined

2,087 views
Skip to first unread message

bobajeff

unread,
Mar 19, 2015, 10:49:09 AM3/19/15
to emscripte...@googlegroups.com
Ive compiled clang to js and I'm pretty sure it uses the filesystem but emscripten didn't seem to include the FS API so I'm getting:
ReferenceError: FS is not defined

When trying to use it. Is there a commandline argument to force emscripten to include it?

Alon Zakai

unread,
Mar 19, 2015, 8:34:12 PM3/19/15
to emscripte...@googlegroups.com
It should be there by default, unless you build with --closure which can minify it out, or NO_FS which will not include it.

- Alon



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bobajeff

unread,
Mar 20, 2015, 9:22:09 AM3/20/15
to emscripte...@googlegroups.com
I looked into the clang.js file and it looks like it's in there. I'm starting to suspect that the problem is clang.js isn't being loaded but my other script calling on FS is being ran anyways.

bobajeff

unread,
Mar 20, 2015, 10:00:11 AM3/20/15
to emscripte...@googlegroups.com
Just tried the onerror attribute on the script tag for clang.js and it didn't get triggered. So apparently it is being loaded. I must be missing something that's happening.

bobajeff

unread,
Mar 20, 2015, 10:46:13 AM3/20/15
to emscripte...@googlegroups.com
Well, I did a few tests:
First I removed the clang.js script tag and it gave the same error as before. I also tried to just do (with the clang.js script tag) Module.callMain and it says "TypeError: Module.callMain is not a function". So it again seems like clang.js isn't loading.

bobajeff

unread,
Mar 24, 2015, 11:05:11 AM3/24/15
to emscripte...@googlegroups.com
I ran the page in slimer.js and it gave out:

Script Error: NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

Stack:

-> file:///home/ec2-user/build/test/testpage/smallfunc/clang.js: 1

Slimer.js broke after the this so I haven't been able to do any other tests.

Jukka Jylänki

unread,
Mar 24, 2015, 1:39:12 PM3/24/15
to emscripte...@googlegroups.com
Try running the page from a http:// URL. That should avoid the BAD_URI message.

Reply all
Reply to author
Forward
0 new messages