CesiumGS / cesium-webpack-example

The minimal recommended setup for an application using Cesium with Webpack.
Apache License 2.0
243 stars 160 forks source link

Build is broken on master #15

Closed tinco closed 4 years ago

tinco commented 4 years ago

To reproduce, clone: https://github.com/tinco/cesium-webpack-example

Run

npm install
npm start

For me (on MacOSX, Node v12.12.0, NPM 6.11.3) it fails with this message:

    ERROR in ./node_modules/esm/esm.js
    Module not found: Error: Can't resolve 'module' in '/Users/tinco/Source/aeroscan/cesium-webpack-example/node_modules/esm'
     @ ./node_modules/esm/esm.js 1:358-375
     @ ./node_modules/cesium/index.js
     @ ./src/index.js
tinco commented 4 years ago

@mramato are you able to reproduce this?

mramato commented 4 years ago

Sorry, I didn't see the issue, thanks for mentioning me. Tested with both Node 10.17 and 12.14 on my Linux system and was unable to reproduce. I wonder if there's some sort of odd mac-only issue going on. @OmarShehata can you take a look at this?

tinco commented 4 years ago

Hi @mramato thanks for checking, did you notice I linked to a version of this repo that has the package.json updated to pull in master?

Since you suggested it might be a mac only thing I made a little docker container to check linux support, and it fails there as well so now I'm not sure what's going on:

FROM node:13.6
ADD . .
RUN npm install
CMD npm start

And then docker build . then docker run -it <hash> and it should print the error.

tinco commented 4 years ago

Woops let's make that:

FROM node:13.6
ADD . .
RUN rm -rf node_modules
RUN npm install
CMD npm start

To make it make sure it really is a clean install. Still reproduces though.

mramato commented 4 years ago

@tinco yes. Grabbing the link for npm master build via the branches page:

  "dependencies": {
    "cesium": "http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/draco-quantization-fix/cesium-1.65.0-draco-quantization-fix33314.tgz"
  },

The above works fine on my machine under both Node 10 and 12.

You mentioned Node 12 in your original description but use Node 13 in your Docker image. Please confirm that you were actually seeing breakage on Node 10 or 12. Node 13 has known breaking changes that is affecting a large number of npm modules. https://github.com/AnalyticalGraphicsInc/cesium/pull/8541 is a start to fixing that but we need to wait for other projects in the npm ecosystem to catch up.

tinco commented 4 years ago

I just tried with node 12, doesn't work there either. But you're pulling in cesium in a different way than I, perhaps I'm simply not pulling in master right. How did you get that package url? I don't see any links to is on the branches page.

Ok I can confirm that using the package it works fine. So there's nothing wrong with master, apparently you just can't depend on cesium by putting just the repo in the package.json.

mramato commented 4 years ago

@tinco If you go to https://github.com/AnalyticalGraphicsInc/cesium/branches you can click on the green checkmark next to a branch and there are a variety of links. One of them is the npm deployment tgz link I used.

You can also reference Cesium locally the way you described, but you need to perform a build first by running npm run makeZipFile command in the Cesium repository. I just tested this and verified it worked.