-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Can't build angular project with Cesium 1.67 (regression?) #8673
Comments
Getting the same error with Cesium 1.67.0 imported ES6 module when running Angular CLI: 9.0.5 Using Ivy Not sure if this is related to the errors I get when running
|
Thanks for reporting this. Were you able to confirm if adding back the line from #8560 resolves this issue @joschne @danieloliveira117 ?
The demo project in angular-cesium seems to work with CesiumJS 1.67. |
I'm fairly confident that this is a webpack configuration issue. If you look in the example demo configuration https://github.com/CesiumGS/cesium-webpack-example/blob/master/webpack.config.js you'll see the this section, instructing webpack to ignore some node libraries: node: {
// Resolve node module use of fs
fs: "empty",
Buffer: false,
http: "empty",
https: "empty",
zlib: "empty"
}, This is because webpack isn't smart enough to know whether these requires ever get executed (in the browser they don't) so it just tries to include everything. Are you able to update the webpack configuration to verify this is the case? |
@mramato It worked! @OmarShehata That demo project appears to use the newer version of angular (version 9). I think this issue can be closed, using the fix below it appears to work for Angular 8. For anyone wondering how to change the webpack config in angular you can use @angular-builders/custom-webpack (make sure to use the correct version - for angular 8 use 8.x.x). Example configuration:
|
Thanks for confirming @danieloliveira117 ! |
@danieloliveira117 thanks very much for your solution. I have merged it to our Angular-Cesium example which can be found here https://github.com/Developer-Plexscape/cesium-angular-example. @joschne I have also added the required configuration of webpack for the warnings that you mentioned. 🙏 @ggetz for your tip CesiumGS/cesium-webpack-example#6 (comment) though |
Hi, Adding this to package.json is now working: |
Make sure to update both the "build" and the "serve" parts in angular.json to use the new webpack config. I didn't need @elanioazul 's addition to package.json to ng9
|
I'm able to build with Angular (that uses webpack) with Cesium v1.66.
But if i upgrade to the 1.67 version, it no longer works:
(There's an error for the modules: http, https and zlib)
The problem was possibly created by #8560.
Operating System: Windows 10 Pro, build 18363
Node version: 12.16.0
Angular version: 8 (not using Ivy)
Note: I'm not using the angular-cesium lib.
The text was updated successfully, but these errors were encountered: