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.

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

See original GitHub issue

Transpile of defu back to CommonJS breaks webpack as it doesn’t support mixing different types of imports.

Had to solve it using:

-    "@nuxtjs/axios": "^5.12.5",
+    "@nuxtjs/axios": "5.13.1",

Not sure if I did roll back to the exact version that fixes the issue, but that was the last working one for the nuxt project I’m working on.

image

Might be related to #498 Please check also https://github.com/unjs/defu/issues/28

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pi0commented, May 24, 2021

I see it might be sometimes hard to reproduce. Would be nice if you can try changing nuxt to nuxt-edge (potential fix https://github.com/nuxt/nuxt.js/pull/9180) and it might be also because of different resolution strategy of npm vs yarn (sandbox and tests are based on yarn).

In either way if even nuxt-edge didn’t fix the issue, would be happy having a quick call to check issue on your website. (https://calendly.com/pi0)

0reactions
datikkencommented, Aug 30, 2021

@rodrigopv I’ve switched to @nuxt/http in that project, but I think it’s still an issue

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 >
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 >
Error: Uncaught TypeError: Cannot assign to read only proper
Uncaught TypeError : Cannot assign to read only property 'exports' of object '#<Object>' at Object.<anonymous> (mdb.js:9192) at Object.
Read more >
Webpack: Cannot assign to read only property 'exports'
Hi, I need to use an external library crypto when running my k6 tests. I'm using the example here: https://github.com/k6io/k6-es6 However on ...
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