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

vite + react: PURE annotation that Rollup cannot interpret #74

Open
BPreisner opened this issue Apr 19, 2024 · 5 comments
Open

vite + react: PURE annotation that Rollup cannot interpret #74

BPreisner opened this issue Apr 19, 2024 · 5 comments
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: rollup 🗞️ Issue is related to rollup bundler needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@BPreisner
Copy link

Packages:

Description

There is an issue with simple styled interpolation upon vite build.

image

When building with Vite:

image

I was trying to switch from styled-components to linaria for our components library and this error is populated for every interpolation in the project. I worry that it's not just a polite warning and may lead to breaking something later.

Reproducible Demo

https://stackblitz.com/edit/vitejs-vite-gfwqu5?file=src%2FApp.tsx

$ npm run build

(There is no issue when running dev command)

@BPreisner BPreisner 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 Apr 19, 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 Apr 19, 2024
@aeharding
Copy link

Related to #62 probably?

@kriakiku
Copy link

Same. With rollup:

{
  "@wyw-in-js/rollup": "0.5.4",
  "@linaria/react": "6.2.1",
  "rollup": "4.24.0"
}

Example of how JS differs after bundling (Left is version 4 of linaria, right is version 6):
image

@agriffis
Copy link

I tried to use patch-package to change these to /*#__NO_SIDE_EFFECTS__*/ but still got a bunch of complaints from rollup. Has anybody else tried this?

@aeharding
Copy link

I tried to use patch-package to change these to /#NO_SIDE_EFFECTS/ but still got a bunch of complaints from rollup. Has anybody else tried this?

No... but it seems harmless enough. I am using Rollup's 'onwarn' option to ignore the warnings for this.

@agriffis
Copy link

agriffis commented Nov 4, 2024

No... but it seems harmless enough. I am using Rollup's 'onwarn' option to ignore the warnings for this.

Sure, you can ignore the warnings. I was hoping to enable the optimization that the pragma intends to achieve, which the warnings indicate is not working.

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: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

4 participants