charto / nbind

:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:
MIT License
1.98k stars 120 forks source link

Emscripten FS API force disabled #120

Open ed-alertedh opened 6 years ago

ed-alertedh commented 6 years ago

I was wondering why I was getting the error "ReferenceError: FS is not defined" when my code tried to access the virtual filesystem. After digging into node_modules/nbind/src/nbind.gypi I found "-s", "NO_FILESYSTEM=1" in cflags.

Emscripten will supposedly only include the FS API based on usage , so unless I am missing something I see no reason to have this setting on by default. I wasn't able to find a way to override it so I had to remove the line from nbind.gypi.

Sorry if I'm spamming your project with issues but I figure that these will help others searching for the causes of any errors they encounter.