Re: webassembly with node.js

2018-10-30 Thread Alon Zakai
Depends on what the cause of the problem is. If your environment is close enough to node.js, maybe you can create a fake require or process object in some JS code that appears before the emscripten output. Or, if it's too different, you may need to modify the emscripten environment detection code.

Re: webassembly with node.js

2018-10-30 Thread shawnr
How would I fix it? On Tuesday, October 30, 2018 at 4:20:51 PM UTC-7, Alon Zakai wrote: > > To debug it, you'd need to look at the values that get assigned into > `ENVIRONMENT_IS_NODE`. That should be > > typeof process === 'object' && typeof require === 'function' && > !ENVIRONMENT_IS_WEB && !E

Re: webassembly with node.js

2018-10-30 Thread Alon Zakai
To debug it, you'd need to look at the values that get assigned into `ENVIRONMENT_IS_NODE`. That should be typeof process === 'object' && typeof require === 'function' && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER So if process or require do not exist, for example, that could explain it. On

Re: webassembly with node.js

2018-10-30 Thread shawnr
I put a console.log() in the js and he reports that ENVIRONMENT_IS_NODE is false. How would that happen? Do I need to import something before the foo.js? The calling js file looks like this: import React, { Component } from 'react' import ContainerDimensions from 'react-container-dimensions' im

Re: webassembly with node.js

2018-10-30 Thread Alon Zakai
Sounds like something went wrong in the environment detection. To debug this, look for var ENVIRONMENT_IS_NODE = in the JS. If you are in node, that should evaluate to true, and none of the other ENVIRONMENT_IS_* should be true. But if you are in a custom non-standard node (or web, or worker, etc

webassembly with node.js

2018-10-30 Thread shawnr
I made a test wasm project using emscripten and it worked fine in the example.html. But when I tried it in a React-flavor of node.js and used: const foo= require('../bin/foo.js') I got hundreds of error messages in the console. Things like: 'read' is not defined 'readbuffer' is not defined 'sc

Re: Removal of EMSCRIPTEN_ROOT from config file

2018-10-30 Thread 'Sam Clegg' via emscripten-discuss
I created a partial revert to keep EMSCRIPTEN_ROOT in the config for now: https://github.com/kripken/emscripten/pull/7411 On Tue, Oct 30, 2018 at 10:09 AM Sam Clegg wrote: > > On Tue, Oct 30, 2018 at 2:16 AM Jukka Jylänki wrote: > > > > > Imagine you run `emcc` and if > > parses the config file a

Re: Removal of EMSCRIPTEN_ROOT from config file

2018-10-30 Thread 'Sam Clegg' via emscripten-discuss
On Tue, Oct 30, 2018 at 2:16 AM Jukka Jylänki wrote: > > > Imagine you run `emcc` and if > parses the config file and finds EMSCRIPTEN_ROOT pointing to different > version of emscripten. > > I would recommend not removing EMSCRIPTEN_ROOT, but rather issuing a > warning if this scenario is met (if

Re: Removal of EMSCRIPTEN_ROOT from config file

2018-10-30 Thread Jukka Jylänki
> Imagine you run `emcc` and if parses the config file and finds EMSCRIPTEN_ROOT pointing to different version of emscripten. I would recommend not removing EMSCRIPTEN_ROOT, but rather issuing a warning if this scenario is met (if we don't already?). It would be a good way to validate that the oth