Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] workshop tutorial failed #838

Closed
zuhrasofyan opened this issue Aug 28, 2018 · 10 comments
Closed

[question] workshop tutorial failed #838

zuhrasofyan opened this issue Aug 28, 2018 · 10 comments

Comments

@zuhrasofyan
Copy link

Guten Tag!

I followed the workshop instruction (https://terrestris.github.io/react-geo-ws/first-steps/) to bootstrap react-geo based app using create-react-app.
Unfortunately, the app failed miserably when I add react-geo dependency.

 sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It seems the react-geo is not compatible with the new react (16.4.2) release? I had to lower react and react-dom version to be able to run it. but again, the installation dependency of antd and ol do have another problem when I start the app:

./node_modules/@terrestris/ol-util/src/MapUtil/MapUtil.js
Module parse failed: Unexpected token (153:25)
You may need an appropriate loader to handle this file type.
|    * @return {ol.layer.Layer} The layer.
|    */
|   static getLayerByOlUid = (map, ol_uid) => {
|     const layers = MapUtil.getAllLayers(map);
|     const layer = layers.find((l) => {

So, is the workshop outdated, or there is some correct way to setup react-geo based app that I have not do?

@dnlkoch
Copy link
Member

dnlkoch commented Aug 29, 2018

Thanks for your report @zuhrasofyan!

The workshop is indeed a bit outdated and hasn't been tested with the newer versions (especially with the latest release) of react-geo for a while, but should work with the latest react at least.

Could you please check if the workshop is working with version 8 by changing it's version to 8.12.1? Taking a quick glance, this worked for me.

@zuhrasofyan
Copy link
Author

The result still the same. But taking from the error message, and after I inspected the react-scripts folder in node_modules, it seems, after I installed react-geo the npm removes some packages including react-scripts. Hence, once I manually install the react-scripts, my application works as usual. (both in v8.12.1 and 9.0.0)

@marcjansen
Copy link
Member

Any chance you might dig deeper and fix the root error? Or upgrade the workshop? That would be much appreciated.

@hwbllmnn
Copy link
Member

Might be unrelated, but I had a similar phenomenon using npm once. After installing a new package with npm install --save <package>, npm would remove some other packages. Just running npm install again reinstalled them. Perhaps this happens with a certain combination of dependencies?

@zuhrasofyan
Copy link
Author

That leaves to the second error message generated by the app:

./node_modules/@terrestris/ol-util/src/MapUtil/MapUtil.js
Module parse failed: Unexpected token (153:25)
You may need an appropriate loader to handle this file type.
    * @return {ol.layer.Layer} The layer.
    */
   static getLayerByOlUid = (map, ol_uid) => {
     const layers = MapUtil.getAllLayers(map);
     const layer = layers.find((l) => {

It only appear when I tried to use react-geo component in v9.0.0. I think that is due to the change in the version release mentioned by @dnlkoch "Breaking changes" of Make use of dedicated util packages

@PeterC66
Copy link
Contributor

PeterC66 commented Sep 2, 2018

I get the same error message when at the Include a react-geo component of the workshop.

I first noticed it when trying to implement react-geo into an existing test react/ node system. Not being able to solve the issue there, I started a new project and followed the workshop instructions exactly - and got the same Module parse error. (I did not get the first error mentioned above.)

I am not very familiar with all the technology and versions. What do I do to get it working?

@marcjansen
Copy link
Member

@PeterC66 Since #851 has two ways to workaround this, can this be closed?

@PeterC66
Copy link
Contributor

PeterC66 commented Sep 4, 2018 via email

@KaiVolland
Copy link
Member

@zuhrasofyan can this be closed or do you have further problems?

@zuhrasofyan
Copy link
Author

Sorry.. Will close the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants