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

Error using cesium in Node 12 or 13 #8452

Closed
lilleyse opened this issue Dec 10, 2019 · 6 comments · Fixed by #8659
Closed

Error using cesium in Node 12 or 13 #8452

lilleyse opened this issue Dec 10, 2019 · 6 comments · Fixed by #8659

Comments

@lilleyse
Copy link
Contributor

The cesium node module does not work in Node 13 due to the upgrade to ES6 modules and a breaking change in Node. The error message looks something like:

Warning: require() of ES modules is not supported.
require() of /Users/tylerlindberg/repos/forks/gltf-pipeline/node_modules/cesium/index.js from /Users/tylerlindberg/repos/forks/gltf-pipeline/gulpfile.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 /Users/tylerlindberg/repos/forks/gltf-pipeline/node_modules/cesium/package.json.

We've seen this issue in obj2gltf and gltf-pipeline:

CesiumGS/gltf-pipeline#507
CesiumGS/obj2gltf#225

@mramato has some ideas for fixing this before the Jan 2 release.

@mramato
Copy link
Contributor

mramato commented Dec 11, 2019

FYI, a ton of projects are affected by this change in NodeJS. even gulp appears to be broken in Node 13. Node 13 is still new and in heavy development so it'snot surprising that a lot of stuff is broken. We may have to wait until things settle down a bit before we can support Cesium in it (that might still happen before the end of they year, but right now it's best to wait and see)

@mramato
Copy link
Contributor

mramato commented Jan 6, 2020

This appears to be related to gulp not working in Node 13 either. I changed it to high and will write up a gulp issue (since I don't see one) and link to it from here.

@mramato
Copy link
Contributor

mramato commented Mar 2, 2020

This appears to be affecting Node 12 now as well.

@mramato
Copy link
Contributor

mramato commented Mar 2, 2020

This is now a major issue because most users are migrating to Node 12. While I don't think it's something we can hurry up and fix in today's release, we absolutely need to address it for 1.68 on April 1 so I updated the tag.

@mramato mramato changed the title Error using cesium in Node 13 Error using cesium in Node 12 or 13 Mar 2, 2020
@mramato
Copy link
Contributor

mramato commented Mar 2, 2020

There are actually two issues here:

  1. Using Cesium as node modules is broken in Node 12 & 13.
  2. Cesium's build system is broken in Node 12 & 13.

2 is a showstopper for 1.68, 3 may be fixable once we address 2 but it may be blocked by third part dependencies (jsDoc).

@mramato
Copy link
Contributor

mramato commented Mar 19, 2020

This is fixed in master and will be released as part of 1.68 on April 1st.

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

Successfully merging a pull request may close this issue.

2 participants