Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
See original GitHub issueUncaught TypeError: Cannot assign to read only property ‘exports’ of object'#<Object>'
webpack:///node_modules/webpack-dev-server/client/clients/BaseClient.js?e917
- Operating System: macOS 10.14.6
- Node Version: 12. v12.18.0
- NPM Version: 6.14.4
- webpack Version: 4.12.0
- webpack-dev-server Version: 3.1.4
- Browser: Chrome Version 85.0.4164.0 (Official Build) canary (64-bit)
This is a bug
Code
https://github.com/littlematch0123/blog-client/blob/master/build/webpack.dev.conf.js
// webpack.config.js
// additional code, remove if not needed.
Expected Behavior
no error
Actual Behavior
crashed
For Bugs; How can we reproduce the behavior?
$ git clone https://github.com/littlematch0123/blog-client
$ yarn
$ npm run dev
# open http://localhost:8888/
For Features; What is the motivation and/or use-case for the feature?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cannot assign to read only property 'exports' of object ...
This error means you are trying to use commonJS inside a ES module. Instead try doing: export default lookup. When you are instantiating...
Read more >Cannot assign to read only property 'exports' of object ... - GitHub
In my react-native-web case, just use an additional webpack rule, then the TypeError: Cannot assign to read only property 'exports' of object is ......
Read more >Uncaught TypeError: Cannot assign to read only property &
When I look at the line it has something to do with bsCustomFileInput. Please insert min.
Read more >TypeError: Cannot assign to read only property 'exports' of ...
The error is generated by Webpack and it means you are trying to use CommonJS while you need to use ES modules!
Read more >Webpack: Cannot assign to read only property 'exports'
... TypeError: Cannot assign to read only property 'exports' at file:///Users/xxx/Desktop/k6-es6-master/build/app.bundle.js:10:364601(98).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The same thing happened to me when trying to update a project generated with old vue-cli from Webpack 3 to 4. In the build/webpack.base.conf.js file you have to remove the include in the loader from babel to webpack-dev-server
and update webpack-dev-server to 3.11.0 in package.json
Thank you for creating this issue. However, issues need to follow one of our templates so that we can clearly understand your particular circumstances.
Please help us help you by recreating the issue using one of our templates.
Answer above