iClient-JavaScript/src/openlayers at master · SuperMap/iClient-JavaScript · GitHub
vue3 默认项目 只引入@supermap/iclient-ol
报错内容
ERROR in ./node_modules/elasticsearch/src/lib/utils.js 2:16-31
Module not found: Error: Can't resolve 'util' in 'E:\My\superdemo\node_modules\elasticsearch\src\lib'
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: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
@ ./node_modules/elasticsearch/src/lib/client.js 32:12-30
@ ./node_modules/elasticsearch/src/elasticsearch.js 12:12-35
@ ./node_modules/@supermap/iclient-common/thirdparty/elasticsearch/ElasticSearch.js 5:0-31 35:26-35
@ ./node_modules/@supermap/iclient-common/thirdparty/elasticsearch/index.js 4:0-46 6:0-23
@ ./node_modules/@supermap/iclient-common/thirdparty/index.js 4:0-48 6:0-25
@ ./node_modules/@supermap/iclient-common/index.common.js 309:0-45 704:0-25
@ ./node_modules/@supermap/iclient-ol/index.js 4:0-54 4:0-54
@ ./node_modules/@supermap/iclient-ol/namespace.js 141:0-24 141:0-24
@ ./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=script&lang=js 7:0-62 20:23-27
@ ./src/App.vue?vue&type=script&lang=js 1:0-122 1:0-122 1:123-234 1:123-234
@ ./src/App.vue 2:0-54 3:0-49 3:0-49 8:49-55
@ ./src/main.js 2:0-27 4:10-13
webpack compiled with 4 errors