-
Notifications
You must be signed in to change notification settings - Fork 412
"Styled" is not working when using production components #840
Copy link
Copy link
Closed
Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: rollup 🗞️Issue is related to rollup bundlerIssue is related to rollup bundlerbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlercat: monorepo 🔱Issues related to usage of linaria in monorepoIssues related to usage of linaria in monorepocat: performance 🚀Issue is related to performanceIssue is related to performanceneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided
Metadata
Metadata
Assignees
Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: rollup 🗞️Issue is related to rollup bundlerIssue is related to rollup bundlerbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlercat: monorepo 🔱Issues related to usage of linaria in monorepoIssues related to usage of linaria in monorepocat: performance 🚀Issue is related to performanceIssue is related to performanceneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided
Type
Fields
Give feedbackNo fields configured for issues without a type.
Environment
Description
So I'm currently trying to build a component library using lerna and linaria due to its build time CSS compilation and in doing so I wanted to avoid code duplication so I thought of making a wrapper component that would be used in every component throughout the library.
However, in doing so I can't seem to get past the following error:
Upon further digging, I found out that this error only happens when I try to import a linaria-styled component that is defined in another package.
Example
I have the following imports in the reproducible repo
The first one is an import from the production build of the wrapper component using rollup and the second one is the component that is straight from the source code. If the first one is active then I get the error that I mentioned above in the browser console and if I use the second code everything seems to compile as expected.
Reproducible Demo
Steps to reproduce
Repo link
https://github.com/utkarshk384/repo-linaria.gitcd ./repo-linaria && yarnSuccessfully created messagepressctrl+csince rollup doesn't seem to exit control flow automatically.localhost:8080.