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

Using the "styled" tag in runtime is not supported #1413

Open
Sanshain opened this issue May 26, 2024 · 0 comments
Open

Using the "styled" tag in runtime is not supported #1413

Sanshain opened this issue May 26, 2024 · 0 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 platform: ssr 🛠️ Issue related to SSR

Comments

@Sanshain
Copy link

Environment

  • @linaria/core version: 5.0.2
  • Bundler (+ version): [email protected]
  • Node.js version: v18
  • OS: Win64
  • Chrome: v125.x
  • run script: rollup -c --environment NODE_ENV:production

Description

I have faced with the problem by using @linaria/rollup plugin:

/// rollup.config.js
plugins:[
        linaria({
            sourceMap: true
        }),
        // ...
        babel({
            exclude: 'node_modules/**',
            babelHelpers: 'bundled',
            configFile: inDevelopment ? './.dev.babelrc' : './.babelrc'         
        }),
]

I looked for similar issues and is it: one and two. In the first one I have found out advice to use it with @linaria/babel-preset. So I did it, but in vain. Nothing has changed.

Bisides that I of cource tryed to follow this steps with @wyw-in-js/rollup. But to be honest it doesn't work at all (even for css tag). I tryed use it also with @wyw-in-js/babel-preset, but it changes nothing. (is there anyone who has it working?). So I returned to options with @linaria/core as at least partially working.

By the way, it seems the second one hasn't been solved, but for some reason closed for some reason despite the problem still is.

Reproducible Demo

Placed in react-hmr-linaria branch here. How to reproduce:

Via degit:

degit Sanshain/preact-boilerplate#ec7b2c5ff60185ff629ab3756fd67bcbcd445187   ## version with `@linaria/rollup` via degit
degit Sanshain/preact-boilerplate#5e2176ac03ff6eb6573fe5522194e822e07ff027   ## version with `wyw` via degit

or via git:

git clone https://github.com/Sanshain/preact-boilerplate.git 
git checkout ec7b2c5ff60185ff629ab3756fd67bcbcd445187   ## version with `@linaria/rollup` via degit
git checkout 5e2176ac03ff6eb6573fe5522194e822e07ff027   ## version with `wyw` via degit

then:

npm i
npm run build

And then open with live server dist/index.html file or just open the file in a browser

@Sanshain Sanshain 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 May 26, 2024
@github-actions github-actions bot added bundler: rollup 🗞️ Issue is related to rollup bundler platform: ssr 🛠️ Issue related to SSR and removed needs: triage 🏷 Issue needs to be checked and prioritized labels May 26, 2024
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 platform: ssr 🛠️ Issue related to SSR
Projects
None yet
Development

No branches or pull requests

1 participant