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

Doesn't work with Parcel? #18

Open
raxod502 opened this issue May 3, 2020 · 2 comments
Open

Doesn't work with Parcel? #18

raxod502 opened this issue May 3, 2020 · 2 comments

Comments

@raxod502
Copy link

raxod502 commented May 3, 2020

I installed version 0.0.4 of react-screen-orientation using Yarn. This caused my app to no longer compile, with the following build error:

$ /home/docker/src/node_modules/.bin/parcel watch --hmr-port 8081 static/admin.html static/index.html
🚨  /home/docker/src/node_modules/react-screen-orientation/src/index.js:8:6: Unexpected token (8:6)
   6 |     const { orientation, children, className } = this.props
   7 |     return (
>  8 |       <div className={`${className} react-orientation react-orientation--${orientation}`}>
     |      ^
   9 |         {children}
  10 |       </div>
  11 |     )

It seems like the package was published to the registry without being compiled?

@raxod502
Copy link
Author

raxod502 commented May 3, 2020

My bad, I see that I missed the lib directory. For some reason, Parcel is looking in the incorrect directory.

@raxod502
Copy link
Author

raxod502 commented May 3, 2020

Worked around the problem by forking and deleting src/index.js. This sounds like a Parcel bug. I also had to change the CSS import path from index to _index as that's the name of the file in src. Not sure what's up with that.

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

1 participant