Hi,

I compiled some simple C library to JavaScript and I'm trying to load the 
library with SystemJS in the browser but this fails because SystemJS 
detects two require() calls in the compiled library:

if (!nodeFS) nodeFS = require('fs');
if (!nodePath) nodePath = require('path');

SystemJS doesn't check if the code is actually executed, it just scans the 
file for the existence of these requires so the files can be asynchronously 
loaded before executing the emscripten code. Naturally this fails because 
there are no "fs" and "path" modules in the browser.

The require() calls are used in the automatically generated read() 
function. I manually removed this function from the code and the library is 
still working and can now be loaded with SystemJS successfully.

Which feature needs this function? Can I disable it somehow? I tried 
setting NO_FILESYSTEM=1 but unfortunately this function is not affected by 
it.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to