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

importing DrawingManager fails for create-react-app #597

Closed
sdwio opened this issue Sep 8, 2017 · 3 comments
Closed

importing DrawingManager fails for create-react-app #597

sdwio opened this issue Sep 8, 2017 · 3 comments

Comments

@sdwio
Copy link

sdwio commented Sep 8, 2017

In an app created via create-react-app using
import DrawingManager from "react-google-maps/src/lib/drawing/DrawingManager";
will fail with the error message

Module parse failed: /.../react-google-maps-test/node_modules/react-google-maps/src/lib/drawing/DrawingManager.js Unexpected token (77:4)
You may need an appropriate loader to handle this file type.
| 
|   propTypes: {
|     ...controlledPropTypes,
|     ...defaultUncontrolledPropTypes,
|   },

Since create-react-app uses a strictely defined build-process I have little influence on the features used.
Object spread is supported by the app.

The requested SO-question.

Example: https://github.com/sdwio/react-google-maps-test

@sdwio
Copy link
Author

sdwio commented Sep 8, 2017

import DrawingManager from "react-google-maps/src/lib/drawing/DrawingManager"; will fail
import DrawingManager from "react-google-maps/lib/drawing/DrawingManager"; is working just fine
in the first case the src was the error

@sdwio sdwio closed this as completed Sep 8, 2017
@sdwio
Copy link
Author

sdwio commented Sep 8, 2017

Careful here: WebStorm proposes the import from src and directly from react-google-maps. Both options will fail. The correct import is not proposed by WebStorm.

@maluramichael
Copy link

Thank you @sdwio good workaround.
@tomchentw what do you think? Is this workaround ok or could this be fixed in the code for everyone?

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

2 participants