-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "FS is not defined" #69
Comments
@sorskoot: Same here please list the steps that you are taking until this error occurs, thanks. |
I had the same issue, it is happening after reloading a page several times on Android/Chrome. |
someone could look at this? same error |
As posted on my branch-PR probably this is a "emscripten" issue the problem is described here: emscripten-core/emscripten#854 and https://stackoverflow.com/questions/15056752/emscripten-using-filesystem-fs |
So maybe the fact that the flow did not 'arrive' till a FS function call, meant that FS was not imported at all. Great, thanks! |
@nicolocarpignoli yes, but the fact remains that the code works for me but not for you, This puzzling me a lot... |
I'm running into the same issue with my own build now. From what I found this is not related to Node.js or but actually a reference to Emscripten's own FS module as described here. Their API seems to have changed now. Reading the documentation I'd expect an FS object to be available on the generated module but I can only see methods like In case anyone has already solved this, how did you do it? |
Solved ... you need to add this to your emscripten module build configuration:
Afterwards |
This is the actual error shown in the console:
artoolkit.api.js:1670 Uncaught ReferenceError: FS is not defined
at writeByteArrayToFS (artoolkit.api.js:1670)
at XMLHttpRequest.oReq.onload (artoolkit.api.js:1689)
It points to this function in artoolkit.api.js:
function writeByteArrayToFS(target, byteArray, callback) {
FS.writeFile(target, byteArray, { encoding: 'binary' });
// console.log('FS written', target);
callback(byteArray);
}
Is there any way to get this fixed? For now I added FS.writeFile as an empty function to the global scope to get rid of the error.
The text was updated successfully, but these errors were encountered: