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.

TypeError: "exports" is read-only

See original GitHub issue

When I try loading vue-pdf in my App.Vue file, I get an odd looking error:

 import pdf from 'vue-pdf'
 export default {
     components: {
	 pdf	 
     },
...
}

TypeError: "exports" is read-only

I don’t have jslint enabled. Any ideas as to what might be causing this? It’s preventing me from being able to use vue-pdf, which looks really cool.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
qualisigncommented, Apr 24, 2017

It compiles fine, so I only get these errors in the console at run time:

TypeError: "exports" is read-only[Learn More]  app.js%20line%201219%20%3E%20eval:306:2
	<anonymous> http://localhost:8080/app.js%20line%201219%20%3E%20eval:306:2
	<anonymous> http://localhost:8080/app.js%20line%201219%20%3E%20eval:1:29
	<anonymous> http://localhost:8080/app.js:1219:1
	__webpack_require__ http://localhost:8080/app.js:687:12
	fn http://localhost:8080/app.js:106:20
	<anonymous> http://localhost:8080/app.js%20line%201646%20%3E%20eval:7:3
	<anonymous> http://localhost:8080/app.js:1646:1
	__webpack_require__ http://localhost:8080/app.js:687:12
	fn http://localhost:8080/app.js:106:20
	<anonymous> http://localhost:8080/app.js%20line%201232%20%3E%20eval:10:66
	<anonymous> http://localhost:8080/app.js:1232:1
	__webpack_require__ http://localhost:8080/app.js:687:12
	fn http://localhost:8080/app.js:106:20
	<anonymous> http://localhost:8080/app.js%20line%201658%20%3E%20eval:7:3
	<anonymous> http://localhost:8080/app.js:1658:1
	__webpack_require__ http://localhost:8080/app.js:687:12
	fn http://localhost:8080/app.js:106:20
	<anonymous> http://localhost:8080/app.js%20line%201185%20%3E%20eval:12:63
	<anonymous> http://localhost:8080/app.js:1185:1
	__webpack_require__ http://localhost:8080/app.js:687:12
	fn http://localhost:8080/app.js:106:20
	<anonymous> http://localhost:8080/app.js:1845:18
	__webpack_require__ http://localhost:8080/app.js:687:12
	<anonymous> http://localhost:8080/app.js:784:18
	<anonymous> http://localhost:8080/app.js:1:11
2reactions
FranckFreiburgercommented, Apr 24, 2017

I tried to reproduce this error with webpack@2.3.3 without success. It seems that this error occurs when one mix esm (import/export) with CommonJS module (require/exports). Please give more details about the error (file/line number)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: "exports" is read-only => When exporting a module ...
javascript - TypeError: "exports" is read-only => When exporting a module with method calling another method - Stack Overflow. Stack Overflow ...
Read more >
Uncaught TypeError: "exports" is read-only · Issue #300 - GitHub
In vue-toastification/composition/nuxt/index.js the line module.exports = { useToast }; causes an error on page load. Uncaught TypeError: " ...
Read more >
TypeError: "exports" is read-only - Get Help - Vue Forum
I have a vue project which I converted into a a library using vue ui so App.vue is the entry point. It created...
Read more >
Uncaught TypeError - is read-only - MDBootstrap
Actual behavior Component is not working and giving Uncaught TypeError:"exports" is read-only in console. Resources (screenshots, code snippets etc.) ...
Read more >
TypeError: "x" is read-only - JavaScript - MDN Web Docs
TypeError : "x" is read-only ... The JavaScript strict mode-only exception "is read-only" occurs when a global variable or object property that was...
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