react-mapbox-gl icon indicating copy to clipboard operation
react-mapbox-gl copied to clipboard

Example fails to compile

Open G2Jose opened this issue 9 years ago • 3 comments

I tried following instructions on https://github.com/alex3165/react-mapbox-gl to run examples. On running npm run start, I get an error saying "Failed to compile", followed by a list of modules that were not found.

Failed to compile.

Error in ./src/all-shapes.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src

 @ ./src/all-shapes.js 14:21-47

Error in ./src/cluster.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src

 @ ./src/cluster.js 26:21-47

Error in ./src/style-update.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src

 @ ./src/style-update.js 14:21-47

Error in ./src/geojson-example.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src

 @ ./src/geojson-example.js 14:21-47

Error in ./src/london-cycle.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src

 @ ./src/london-cycle.js 14:21-47

I also tried re-linking by running npm run link but that did not help.

G2Jose avatar May 14 '17 05:05 G2Jose

Hey I striped out everything and install node modules from scratch and I don't get any issue with running the examples, can you please try again from a clean git clone, it shouldn't happen.

alex3165 avatar May 14 '17 17:05 alex3165

I have got this issue too.I have to clone this repo and cd to example directory and install dependency with yarn install.So I got this Error when I use yarn start.

nontachaiwebdev avatar Jun 04 '17 16:06 nontachaiwebdev

This can be fixed by installing mapbox-gl in your app, since it's a peerDep:

$ yarn add mapbox-gl

Haroenv avatar Jun 24 '17 10:06 Haroenv