Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require() of ES Module /node_modules/three/examples/jsm/renderers/CSS2DRenderer.js from /workspace/storie/spacex/node_modules/globe.gl/dist/globe.gl.common.js not supported. Instead change the require of CSS2DRenderer.js in /node_modules/globe.gl/dist/globe.gl.common.js to a dynamic import() which is available in all CommonJS modules #105

Closed
chientrm opened this issue Apr 26, 2022 · 4 comments

Comments

@chientrm
Copy link

Describe the bug

require() of ES Module /node_modules/three/examples/jsm/renderers/CSS2DRenderer.js from /workspace/storie/spacex/node_modules/globe.gl/dist/globe.gl.common.js not supported. Instead change the require of CSS2DRenderer.js in /node_modules/globe.gl/dist/globe.gl.common.js to a dynamic import() which is available in all CommonJS modules

To Reproduce
Steps to reproduce the behavior:

  1. npm init
  2. Add 'type': 'module' to package.json
  3. npm run build using vite

Expected behavior
Build distribution

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser: [e.g. stock browser, Safari]
  • Version: [e.g. 22]

Additional context
Add any other context about the problem here.

@rasmusfredrik
Copy link

Hello, we resolved the issue using a dynamic import in Next Js
const ReactGlobe = dynamic(import('react-globe.gl'), { ssr: false })

@chientrm
Copy link
Author

chientrm commented May 2, 2022

Hello, we resolved the issue using a dynamic import in Next Js const ReactGlobe = dynamic(import('react-globe.gl'), { ssr: false })

I resolved this by dynamic import in svelte, too. 👍

@chientrm chientrm closed this as completed May 4, 2022
@stefanreifenberg
Copy link

hey @chientrm I would love to see how you implemented globe.gl in svelte. Cheers

@chientrm
Copy link
Author

chientrm commented Nov 4, 2022

hey @chientrm I would love to see how you implemented globe.gl in svelte. Cheers

I no longer use globe.gl. Please check my three-js globe I implemented myself 👍 .
https://github.com/chientrm/spacex/blob/main/src/lib/components/Globe.svelte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants