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

Pure warning when wrapping Ionic component with styled API #62

Open
aeharding opened this issue Feb 11, 2024 · 1 comment
Open

Pure warning when wrapping Ionic component with styled API #62

aeharding opened this issue Feb 11, 2024 · 1 comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: rollup 🗞️ Issue is related to rollup bundler needs: investigation 🔎 Issue has to be investigated for reason or solution

Comments

@aeharding
Copy link

Environment

  • wyw-in-js version: 0.4.0
  • custom processor: react
  • Bundler (+ version): vite 5.1.1
  • Node.js version: v20.8.1
  • OS: macOS

Description

When building my React + Vite + Typescript + Ionic project, I see the following warning:

vite v5.1.1 building for production...
src/pages/Home.tsx (1:0) A comment

"/*#__PURE__*/"

in "src/pages/Home.tsx" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.

If you look at Home.tsx you will see I am wrapping the IonHeader component provided by the Ionic library with the Linaria styled API.

When doing this, I get the above console warning.

If I change styled(IonHeader) to styled.div the warning is gone.

Reproducible Demo

I am not sure if this is an Ionic, linaria or wyw issue, but I am guessing wyw because I do not get this warning when using the Emotion styled API.

@aeharding aeharding added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Feb 11, 2024
@github-actions github-actions bot added bundler: rollup 🗞️ Issue is related to rollup bundler and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Feb 11, 2024
@layershifter layershifter added needs: investigation 🔎 Issue has to be investigated for reason or solution and removed needs: complete repro 🖥️ Issue need to have complete repro provided labels Feb 11, 2024
@dlehmhus
Copy link

I think the issue is that the extracted expressions are marked as pure (what webpack understands), whereas rollup expects them to be marked as side effect free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: rollup 🗞️ Issue is related to rollup bundler needs: investigation 🔎 Issue has to be investigated for reason or solution
Projects
None yet
Development

No branches or pull requests

3 participants