martinadamsdev/vue-cesium-webpack-starter

[Bug]

Closed this issue · 0 comments

错误信息:
ERROR Failed to compile with 3 errors 21:53:29

error in ./node_modules/zlib/lib/zlib.js

Module not found: Error: Can't resolve './zlib_bindings' in 'E:\CesiumProjects\cesiumtest\node_modules\zlib\lib'

error in ./node_modules/cesium/Source/Core/Resource.js

Module not found: Error: Can't resolve 'https' in 'E:\CesiumProjects\cesiumtest\node_modules\cesium\Source\Core'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }

error in ./node_modules/cesium/Source/Core/Resource.js

Module not found: Error: Can't resolve 'http' in 'E:\CesiumProjects\cesiumtest\node_modules\cesium\Source\Core'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

ERROR in ./node_modules/zlib/lib/zlib.js 1:0-43
Module not found: Error: Can't resolve './zlib_bindings' in 'E:\CesiumProjects\cesiumtest\node_modules\zlib\lib'
@ ./node_modules/cesium/Source/Core/Resource.js 2064:30-44
@ ./node_modules/cesium/Source/Cesium.js 180:0-57 180:0-57
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HelloWorld.vue?vue&type=script&lang=js& 2:0-33 14:21-34 15:27-60 28:19-48
@ ./src/components/HelloWorld.vue?vue&type=script&lang=js& 1:0-204 1:220-223 1:225-426 1:225-426
@ ./src/components/HelloWorld.vue 2:0-62 3:0-57 3:0-57 10:2-8
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/App.vue?vue&type=script&lang=js& 1:0-53 5:4-14
@ ./src/App.vue?vue&type=script&lang=js& 1:0-191 1:207-210 1:212-400 1:212-400
@ ./src/App.vue 2:0-55 3:0-50 3:0-50 10:2-8
@ ./src/main.js 2:0-28 10:17-20

ERROR in ./node_modules/cesium/Source/Core/Resource.js 2069:41-56
Module not found: Error: Can't resolve 'https' in 'E:\CesiumProjects\cesiumtest\node_modules\cesium\Source\Core'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
@ ./node_modules/cesium/Source/Cesium.js 180:0-57 180:0-57
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HelloWorld.vue?vue&type=script&lang=js& 2:0-33 14:21-34 15:27-60 28:19-48
@ ./src/components/HelloWorld.vue?vue&type=script&lang=js& 1:0-204 1:220-223 1:225-426 1:225-426
@ ./src/components/HelloWorld.vue 2:0-62 3:0-57 3:0-57 10:2-8
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/App.vue?vue&type=script&lang=js& 1:0-53 5:4-14
@ ./src/App.vue?vue&type=script&lang=js& 1:0-191 1:207-210 1:212-400 1:212-400
@ ./src/App.vue 2:0-55 3:0-50 3:0-50 10:2-8
@ ./src/main.js 2:0-28 10:17-20

ERROR in ./node_modules/cesium/Source/Core/Resource.js 2069:59-73
Module not found: Error: Can't resolve 'http' in 'E:\CesiumProjects\cesiumtest\node_modules\cesium\Source\Core'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
@ ./node_modules/cesium/Source/Cesium.js 180:0-57 180:0-57
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HelloWorld.vue?vue&type=script&lang=js& 2:0-33 14:21-34 15:27-60 28:19-48
@ ./src/components/HelloWorld.vue?vue&type=script&lang=js& 1:0-204 1:220-223 1:225-426 1:225-426
@ ./src/components/HelloWorld.vue 2:0-62 3:0-57 3:0-57 10:2-8
@ ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/App.vue?vue&type=script&lang=js& 1:0-53 5:4-14
@ ./src/App.vue?vue&type=script&lang=js& 1:0-191 1:207-210 1:212-400 1:212-400
@ ./src/App.vue 2:0-55 3:0-50 3:0-50 10:2-8
@ ./src/main.js 2:0-28 10:17-20

package.json:
{
"name": "cesiumtest",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@open-wc/webpack-import-meta-loader": "^0.4.7",
"browserify-zlib": "^0.2.0",
"cesium": "^1.97.0",
"compression-webpack-plugin": "^10.0.0",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.8.3",
"css-loader": "^6.7.1",
"element-ui": "^2.15.9",
"http": "^0.0.1-security",
"https": "^1.0.0",
"https-browserify": "^1.0.0",
"sass": "^1.54.5",
"sass-loader": "^13.0.2",
"url": "^0.11.0",
"vue": "^2.6.14",
"vuex": "^3.6.2",
"zlib": "^1.0.5"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-template-compiler": "^2.6.14"
}
}