question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

See original GitHub issue

Uncaught 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

image

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

36reactions
Almansadcommented, Sep 18, 2020

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

Berfore

    {
       test: /\.js$/,
       loader: 'babel-loader',
       include: [
         resolve('src'),
         resolve('test'),
         resolve('node_modules/webpack-dev-server/client') <--- delete disline
       ]
     }

After

      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: [
          resolve('src'),
          resolve('test')
        ]
      }

and update webpack-dev-server to 3.11.0 in package.json

0reactions
alexander-akaitcommented, Nov 17, 2020

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

Read more comments on GitHub >

github_iconTop 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 &#38
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found