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

Linaria monorepo help/bug. #501

Closed
ShanonJackson opened this issue Oct 28, 2019 · 2 comments
Closed

Linaria monorepo help/bug. #501

ShanonJackson opened this issue Oct 28, 2019 · 2 comments
Assignees
Labels
babel-plugin bug 🐛 Issue is a confirmed bug

Comments

@ShanonJackson
Copy link

ShanonJackson commented Oct 28, 2019

Environment

windows (10)
linaria 1.3.1
NextJS (latest)

Description

Linaria ceases to be able to evaluate expressions IE nested selectors, and referencing constants in other files in another workspace in a monorepo.

Reproducible Demo

https://github.com/ShanonJackson/linariamono

Instructions

yarn install
cd zones/home
npm run dev
(Notice nested style evaluation error when the linaria syntax is completely valid)
go to pages/index.js
comment shared/Button/Button
uncomment ../Components/Button

Error completely vanishes when its that exact same code within the same workspace.

@satya164

Hoping you guys can get back to me on this tried to make reproduction as lean as humanly possible whilst simulating my problem.

EDIT: Sorry don't want to waste time in your investigation but just want to reiterate this problem only appears when importing linaria components/css that used nested selectors + use imported variable constants in a workspace monorepo... must have something to do with the evaluation

@Anber Anber self-assigned this Oct 28, 2019
@Anber Anber added babel-plugin bug 🐛 Issue is a confirmed bug labels Oct 28, 2019
@ShanonJackson
Copy link
Author

Accidentally hit close and comment my bad, hadn't had my morning coffee not my proudest moment, Thanks @Anber for looking into this.

@ShanonJackson ShanonJackson reopened this Oct 28, 2019
@ShanonJackson
Copy link
Author

ShanonJackson commented Oct 29, 2019

Fixed. After 10+ hours trying to to different setups using yarn/npm/babel-module-resolver plugins finally after taking a break and going back to the docs the solution was right there.
ignore: /node_modules[\/\\](?!shared)/, in next.config.js linaria/loader

yarn dev
works.

Updated with repo with the working code for those who stumble across this looking for answers on how to setup mono repo + nextjs + linaria.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
babel-plugin bug 🐛 Issue is a confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants