react-map-gl
react-map-gl copied to clipboard
webpack 5 not supported?
Hi, I recently upgraded project webpack from version 4.46.0 to 5.21.0 and there seems to be a build issue with react-map-gl compatibility. I had version react-map-gl version 5.2.7 installed, and working fine, after upgrading webpack the project doesn't build , when upgrading to any newer react-map-gl version either. What changes are needed in the configuration in order to build with webpack 5?
Hi @alonmeiri
Could you please provide build error logs?
Hi, thanks for the quick reply
here is an example log, I am getting a bunch of these :
ERROR in ./node_modules/react-map-gl/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js 4:0-52 Module not found: Error: Can’t resolve ‘./nonIterableSpread’ in ‘/Users/sahara/git/dview/client/node_modules/react-map-gl/node_modules/@babel/runtime/helpers/esm’ Did you mean ‘nonIterableSpread.js’? BREAKING CHANGE: The request ‘./nonIterableSpread’ failed to resolve only because it was resolved as fully specified (probably because the origin is a ‘.mjs’ file or a ‘.js’ file where the package.json contains ‘“type”: “module”’). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. @ ./node_modules/react-map-gl/dist/esm/components/interactive-map.js 2:0-78 369:41-59 @ ./node_modules/react-map-gl/dist/esm/index.js 1:0-55 1:0-55 2:0-73 2:0-73 @ ./src/components/map_component/mapbox.js 18:42-65 @ ./src/components/dashboard_pages/level_pages/factory_level/factory_page.js 22:37-77 @ ./src/components/dashboard_pages/level_pages/factory_level/factory_page_container.js 18:43-68 @ ./src/components/dashboard_pages/dashboard_page.js 16:53-139 @ ./src/components/site_page/site_page.js 36:45-89 @ ./src/components/site_page/site_page_container.js 22:40-62 @ ./src/App.js 16:50-101 @ ./src/index.js 9:34-50 16 errors have detailed information that is not shown. Use ‘stats.errorDetails: true’ resp. ‘--stats-error-details’ to show it.
Hi @stepankuzmin Trying to install and use the library in my react project, I've run into a bunch of errors (logs.txt). I've repeated the installations on clean builds (create-react-app), but the errors persisted. Maybe there are ideas how to fix it? p.s. I managed to remove some errors by installing assert, path, util packages. But other errors still remain.
UPD. Sorry for disturbing. I solved the issue. For those who will have problems during a build, pay attention to this.
Still compilation error with webpack5+. But no proper guide to fix this issue !! lots of error occured during build with webpack 5+