3DTilesRendererJS: help wanted for a problem using the package in a NuxtJS application
Hi,
I’m trying to embed the package in a NuxtJS application already displaying 3D scenes with ThreeJS, but get the following error when the vue containing the import ... from '3d-tiles-renderer'
clause is loaded :
Must use import to load ES Module: /path/to/project/node_modules/3d-tiles-renderer/src/index.js require() of ES modules is not supported. require() of /path/to/project/node_modules/3d-tiles-renderer/src/index.js from /path/to/project/node_modules/vue-server-renderer/build.dev.js is an ES module file as it is a .js file whose nearest parent package.json contains “type”: “module” which defines all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove “type”: “module” from /path/to/project/node_modules/3d-tiles-renderer/package.json.
I understand that it has something to do with imports and require statements, but didn’t succeed in fixing the problem even after trying the various suggestions (including patching dependencies code !!) found by Googling.
I confess not being expert in JS packaging wizardry and that posts involving babel and friends didn’t help me very much, although I’ve the feeling that the solution is maybe there.
Thanks a lot in advance for any indication which could help me solve this issue.
Best regards.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (7 by maintainers)
That’s fine for me. I’ll keep you informed.