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

Comments

1 participant
@interglobalmedia
Copy link
Owner

interglobalmedia commented Dec 2, 2018

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 created this issue from a note in React Workflow 2nd Edition Updated 2018 (In progress) Dec 2, 2018

@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 label Dec 2, 2018

@interglobalmedia

This comment has been minimized.

Copy link
Owner

interglobalmedia commented Dec 2, 2018

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

This comment has been minimized.

Copy link
Owner

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 interglobalmedia self-assigned this Dec 3, 2018

React Workflow 2nd Edition Updated 2018 automation moved this from In progress to Done Dec 3, 2018

React Workflow 2nd Edition Updated 2018 automation moved this from Done to In progress Dec 3, 2018

@interglobalmedia

This comment has been minimized.

Copy link
Owner

interglobalmedia commented Dec 3, 2018

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