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

Fixing import issue with Jest 23.6 breaks using class properties in React 16.6.3 #1

Open
interglobalmedia opened this issue Dec 2, 2018 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@interglobalmedia
Copy link
Owner

FYI: fixing the import issue with Jest breaks using class properties shorthand and breaks dev build. Get the following in Terminal when running npm run start script:

ERROR in ./src/App.js

/Users/mariacam/Development/text-to-speech-app/src/App.js
2:18 error Parse errors in imported module './components/text/Text': Unexpected token = (6:11) import/namespace
2:18 error Parse errors in imported module './components/text/Text': Unexpected token = (6:11) import/default
2:18 warning Parse errors in imported module './components/text/Text': Unexpected token = (6:11) import/no-named-as-default
2:18 warning Parse errors in imported module './components/text/Text': Unexpected token = (6:11) import/no-named-as-default-member

✖ 4 problems (2 errors, 2 warnings)

@interglobalmedia interglobalmedia changed the title Fixing import issue with Jest breaks using class properties in React 16.6.3 Fixing import issue with Jest 23.6 breaks using class properties in React 16.6.3 Dec 2, 2018
@interglobalmedia interglobalmedia added the bug Something isn't working label Dec 2, 2018
@interglobalmedia
Copy link
Owner Author

Not really quit sure if this is a bug or not, but it is not working as expected. This is not terrible since class properties have not even been approved yet, but still interested to know why it throws an error even though I have installed the Babel plugin @babel/plugin-proposal-class-properties and have it in .babelrc as well.

@interglobalmedia
Copy link
Owner Author

interglobalmedia commented Dec 3, 2018

I figured out the solution to this problem last night and wrote an article about it entitled The New Babel 7 Config. For anyone interested in adding images to their projects, I also wrote an article about importing images in this second edition of the workflow entitled Importing Images in React 2.0: Jest (and Babel 7) and one on the "side effects" that resulted from such changes entitled The Jest Side Effect.

@interglobalmedia
Copy link
Owner Author

I am re-opening this issue (even though it has been resolved) so people visiting the repository will be made aware of it and the associated posts describing the process and eventual solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant