-
-
Notifications
You must be signed in to change notification settings - Fork 276
Can't build production file #176
Comments
I had the same problem. Adding this to webpack config managed to fix it:
The production build seems to work even though it reports errors during the build process. |
@davidshore Thank you so much. I upgraded from CRA 1 to 2 and there was exactly the same issue. I set the webpack config so that the problem is completely resolved. |
nice thank you |
I'm getting the same error; Does anyone know what's actually causing this? A proper fix would be great. thanks so much for the |
Now it is exporting the files which is very good this is how am using the worker in my component:
Note my worker is located within the directory of the component is that right?
my excel.worker file:
Please help :( |
Okay now it is working fine |
If you are using create-react-app, run this command from your app dir:
This will show any errors preventing build. |
BTW the fix to get this working with module.exports = function override(config, env) {
config.module.rules.push({
test: /\.worker\.js$/,
use: { loader: 'worker-loader' }
})
config.output.globalObject = '(self || this)'
return config
} |
Solved by putting
|
Here difference problem, they are were reported:
|
* 'yarn start' works but 'yarn build' not * fix worker-loader and eslint issue reported in webpack-contrib/worker-loader#176 * workernize
I used create react app to create my app. I ejected the config files as I had to add the following configs into webpack:
But when I try to build for production (
npm run build
), no files are generated:No files shows up after
File sizes after gzip:
and the build folder only containsfavicon.ico
andmanifest.json
.The application works though when I launch it with
npm start
.I tried using
react-app-rewired
to avoid ejecting, but I have the same problem anyway + another set of problems, so I gave up with this library...When I remove the code specific to web workers, the build then works.
webpack version is "4.19.1",
worker loader version is "^2.0.0"
The text was updated successfully, but these errors were encountered: