ReferenceError: require is not defined in ES module scope, you can use import instead
See original GitHub issueDescribe the bug ReferenceError: require is not defined in ES module scope, you can use import instead
To Reproduce
"plyr-react": "^5.0.2",
Expected behavior For some reason, the library breaks the compiler when used inside a Node Module.
Screenshots
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:14 (4 by maintainers)
Top Results From Across the Web
require is not defined in ES module scope, you can use import ...
ReferenceError: require is not defined in ES module scope, you can use import instead gulp sass ; require('gulp-sass')( ; module babel-register ...
Read more >How to fix the error `require is not defined` in Node.js
Solution · change the type of modules in package.json to commonjs : "type": "commonjs" · delete the string "type": "module" from the file...
Read more >How To Fix ReferenceError require is not defined in JavaScript
In this case, check your package.json file for an property called type . If that is set to module , ES6 modules will...
Read more >ReferenceError: require is not defined in JavaScript | bobbyhadz
To solve the "ReferenceError require is not defined" error, use the ES6 module import and export syntax. The require() function is Node.js specific...
Read more >How to fix "require is not defined" in JavaScript / Node.js?
If you are getting the “ReferenceError: require is not defined” or “require-is-not-defined” error in Node.js, you probably either have set the ...
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 FreeTop 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
Top GitHub Comments
plyr-react@5.1.0 was published.
Please check now
I created this PR. https://github.com/chintan9/plyr-react/pull/892 This fixes the issue. Don’t know why they are not merging.