-
Notifications
You must be signed in to change notification settings - Fork 27
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
WebPack 4 breaks Web Worker #12
Comments
There seems to be a bug in your EXR Worker, running your example I get the error |
So maybe the cause of this issue is a newer version of webpack that does things differently? |
Maybe... when I let the build run in the node debugger I get pointed to this:
|
@cbreak-black, what should I read from the debugger output? |
It looks as if the worker-loader tries to get a context member of |
Hm okay. I noticed that jeri.io uses webpack 3 and worker-loader 1, and the current verisons are 4 and 2 respectively. Maybe the rules changed ... |
Yes, that seems to be the culprit. worker-loader 1.1.1 (instead of 1.1.0) seems to fix the bug we encounter here, but it doesn't seem to be enough to work with webpack 4. Some of your dependencies seem to force the new version onto us. I'll look into what is required to update our code to use webpack 4 / worker-loader 2, that should circumvent the problem. |
This might also give us some trouble later: webpack/webpack#7352 |
Check out https://github.com/disneyresearch/jeri/tree/experiments/webpack4, this seems to work enough with webpack 4 to work in the examples, but integrating in your test doesn't work yet. But at least it doesn't fail to compile anymore. |
FYI: I was able to build this version and install it locally into a different project (react-app) using npm link. It works but EXR images are not being displayed. They are downloaded successfully but then nothing appears in the window. Probably something with exr-parser.worker.js. I'll dig into it. |
What happens here is that "exr.worker.js" gets downloaded. I have no idea where from. And this file has an error on line 2: This file is supposed to be generated out of |
Yes, I'm getting the |
Seems to be related to webpack/webpack#6642 |
Yep. I tried adding |
The issue is not JERI related I think, but caused by the webpacking done by create-react-app. Our own webpack config isn't considered, it wasn't even bundled in the npm pack. |
Hmm... can we |
After ejecting, you should be able to edit |
How did you eject? There is no script to run |
I did |
After ejecting my test app and adding the globalObject option I'm getting:
I have file-loader 2.0.0 installed. Any idea? |
So, finally got that weird react app creator thingie to work, for "release" mode. And I hope I didn't forget anything, because this was messy. (I hate webdev... :). I don't know how people can get anything done like this.
|
Nice! For me, it was sufficient to eject and make the changes you listed in bullet 3 (default rules and wasm exclude). I didn't need to install webpack-cli and do the rest of what you described. I'm not getting any errors anymore and the EXR image appears. Thanks for looking into this! |
The only annoying thing is that one needs to eject. I wonder if there is a way to change webpack settings without ejecting. |
Perfect, but I assume you still had to use the "updated" version of jeri's experimental webpack 4 branch , or did it not matter? I don't know much about ejecting, but it seems you can also fork react-scripts: https://facebook.github.io/create-react-app/docs/alternatives-to-ejecting (To me that sounds a lot more annoying) |
I used your webpack 4 branch. Thanks for the link, I'll have a look. |
It seems to me like worker-loader etc. are very shaky. It's hard to get it to put the emscripten-related code exactly where it needs to me. Especially because this depends on the user's webpack config. My suggestion would be to let users manually copy the three related files (exr-paser.worker.js, exr-wrap.js, exr-wrap.wasm) to the root of their web server and drop the worker-loader and file-loader stuff. |
Would |
If you put them in the public folder of your react project, they will be served in the web root, so that would work. Note that if these files change, the user needs to update them manually ... |
Yes, that is true. |
Webpack 4.31 seems to work somewhat reliably. |
Hi,
I'm unable to use the NPM version of JERI as expected. See this test case (run ./run_test.sh) (requires Docker).
When using
npm install --save
, the script doesn't run, and errorsCannot read property 'context' of undefined
. When usingyarn add
, the viewer loads and can display PNGs but is stuck on 'Downloading ...' in a tab featuring an EXR image.The text was updated successfully, but these errors were encountered: