amplify-ui: Cannot find module: 'mapbox-gl'
Before creating a new issue, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
On which framework/platform are you having an issue?
React
Which UI component?
Other
How is your app built?
CRA or 3.4.1 or 4.0.3
Please describe your bug.
Creating an optimized production build...
Failed to compile.
./node_modules/react-map-gl/dist/esm/components/map.js
Cannot find module: 'mapbox-gl'. Make sure this package is installed.
You can install this package by running: npm install mapbox-gl.
What’s the expected behaviour?
Should build without issues
Help us reproduce the bug!
Do a prod build with CRA 3 or 4 and @aws-amplify/ui-react package.
Code Snippet
// Put your code below this line.
Additional information and screenshots
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- add mapbox-gl https://github.com/aws-amplify/amplify-ui/issues/1736 — committed to cmbrehm/cypress-react-amplify by cmbrehm 2 years ago
- Merge pull request #2 from cmbrehm/react18 add mapbox-gl https://github.com/aws-amplify/amplify-ui/issues/1736 — committed to cmbrehm/cypress-react-amplify by cmbrehm 2 years ago
Is there a reason to use the
empty-npm-packagespecifically for satisfying/faking themapbox-glpeer dependency, aside from that being the suggested answer by themapbox-glteam? The reason I ask is the package seems sketchy when viewing it on NPM: no README, no repo to view its source, and hasn’t been touched for several years. You can download the tarball from the registry which shows the package is benign, but, looking at it from a supply-chain-security point of view, using what appears to be a random package doesn’t inspire much confidence.I propose we reform this issue to capture the error of
Cannot find module: 'mapbox-gl'since multiple users have reported this problem across, potentially, multiple build tools (here and here). What I’ll ask of users that encounter this error is to provide the following: