`Error: 'Body' is not exported by ...` -- need to use `rollup-plugin-commonjs` to handle CJS files
See original GitHub issueHere is my code:
import { Body } from 'cannon';
class CannonCollider extends Body {
//....
}
Hints me that
Error: 'Body' is not exported by node_modules\cannon\build\cannon.js
I have installed the cannon
and @types/cannon
.
Here is my tsconfig:
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
},
// NO USE:
// "include": [
// "@types/**/*.d.ts",
// "./**/*.d.ts",
// "./**/*.ts"
// ],
"exclude": [
"node_modules",
]
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
'name' is not exported by node_modules/... - even with explicit ...
I'm trying to use Rollup to bundle a test suite that uses tape. ... My configuration file is: import commonjs from 'rollup-plugin-commonjs'; ...
Read more >Rollup Error: 'default' is not exported by node_modules/react ...
js but I have trouble regarding the plugin @rollup/plugin-commonjs. My rollup.conf.js. import resolve from '@rollup/plugin-node-resolve'; ...
Read more >Introduction - rollup.js
Introduction. Overview. Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, ...
Read more >rollup.js
If you want to write your configuration as a CommonJS module using require and module. exports , you should change the file extension...
Read more >Bundling with Rollup - Vue.js 3 Course
commonjs (extension .cjs.js , for use with node.js) ... Add export default {} and run yarn rollup -c rollup.config.js . ... Error: Could...
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
Hey @ezolenko , I have resolved this problem by introducing commonjs plugin and do as following:
My rollup config:
@shrinktofit could you post your rollup config?