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

styled-jsx messed up when using .babelrc on root and using next on a subfolder #743

Closed
mattecapu opened this issue Jan 11, 2017 · 7 comments

Comments

@mattecapu
Copy link

mattecapu commented Jan 11, 2017

It's a weird issue I managed to downsize to this minimal use case.
Clone the repo and then run

npm install
npm start

and go to localhost:3000.

Expected behaviour: render a green, a red and a purple line of text.
Observed behaviour: renders 3 lines of green text.

It appears to be caused by running next inside a subdirectory, where it doesn't find a .babelrc file. Indeed, a temporary fix is to add a copy of your root .babelrc in the subdirectory as well.
The only effect seems to be messing up with styled-jsx encapsulation (confusing children and parent styles). Everything else is transpiled correctly.

@timneutkens
Copy link
Member

@mattecapu I guess this is because of the .babelrc fallback. Can you how the .babelrc in your root folder?

@mattecapu
Copy link
Author

it's all in the repo

@timneutkens
Copy link
Member

@mattecapu oh sorry, I totally missed that <3

@mattecapu
Copy link
Author

nothin on this? how can I fix?

@arunoda
Copy link
Contributor

arunoda commented Jan 16, 2017

That seems like a weird bug. Let's see.

@arunoda
Copy link
Contributor

arunoda commented Jan 16, 2017

@nkzawa any pointers?

@arunoda
Copy link
Contributor

arunoda commented Jan 16, 2017

Research Notes.

Check these two gists: https://gist.github.com/arunoda/2307c8f6535a794185726ac8d5297bf1
Seems like data-jsx id getting set twice when we set a custom babelrc
May be this check getting failed: https://github.com/zeit/styled-jsx/blob/master/src/babel.js#L82

arunoda added a commit to arunoda/styled-jsx that referenced this issue Jan 16, 2017
rauchg pushed a commit to vercel/styled-jsx that referenced this issue Jan 16, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
wroy7860 added a commit to wroy7860/styled-jsx-github-React-and-node that referenced this issue Sep 19, 2022
ericbrown2716 added a commit to ericbrown2716/styled-jsx-react-repo that referenced this issue Sep 29, 2022
renawolford6 pushed a commit to renawolford6/styled-jsx-development-react-and-node that referenced this issue Oct 6, 2022
johnfrench3 pushed a commit to johnfrench3/styled-jsx-Build-React that referenced this issue Nov 2, 2022
JiachenSmith pushed a commit to JiachenSmith/styled-jsx that referenced this issue Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants