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 src/ with latest CRA errors gets syntax error #50

Closed
zhil opened this issue Jun 8, 2020 · 2 comments
Closed

Importing src/ with latest CRA errors gets syntax error #50

zhil opened this issue Jun 8, 2020 · 2 comments
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue author has not responded solution: invalid

Comments

@zhil
Copy link

zhil commented Jun 8, 2020

Library cant be used with create-react-app by default because of error
image

@babel/plugin-proposal-class-properties cant be added without ejecting CRA, which is pain.
CRA explanations
image
image

Not sure how to fix it, is it possible to change that experemental syntax?

related issues
facebook/create-react-app#4648
material-components/material-components-web-react#107

@zhil
Copy link
Author

zhil commented Jun 8, 2020

ok, I tried to use another CRA version, which I supposed to have that babel plugin enabled - because your library works fine for me in another project.
But it failed with the same error.

And I noticed, that in other project I have

import SignatureCanvas from "react-signature-canvas";

and in current project autocompletion added

import SignatureCanvas from "react-signature-canvas/src";

First import works just fine, so issue is solved for me.

Not sure about all that "experemental syntax" stuff - probably, we could close this issue if its false error.

@agilgur5 agilgur5 added solution: invalid kind: support Asking for support with something or a specific use case labels Jun 8, 2020
@agilgur5 agilgur5 changed the title Latest CreateReactApp crushed with Support for the experimental syntax 'classProperties' isn't currently enabled Importing 'src/' with latest CRA errors gets syntax error Jun 8, 2020
@agilgur5
Copy link
Owner

agilgur5 commented Jun 8, 2020

Yea you imported src/, which as you might imagine, contains untranspiled source code. If you import regularly, you'll get the transpiled code.

src/ is really only there to aid in debugging along with the sourcemaps, and not to be imported directly in code.

@agilgur5 agilgur5 closed this as completed Jun 8, 2020
@agilgur5 agilgur5 added the problem: stale Issue author has not responded label Mar 13, 2021
Repository owner locked as resolved and limited conversation to collaborators Mar 13, 2021
@agilgur5 agilgur5 changed the title Importing 'src/' with latest CRA errors gets syntax error Importing src/ with latest CRA errors gets syntax error Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue author has not responded solution: invalid
Projects
None yet
Development

No branches or pull requests

2 participants