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

object interpolations stop working for some case #995

Closed
Mavrin opened this issue Jun 17, 2022 · 1 comment
Closed

object interpolations stop working for some case #995

Mavrin opened this issue Jun 17, 2022 · 1 comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@Mavrin
Copy link

Mavrin commented Jun 17, 2022

Environment

  • Linaria version: 3.0.0-beta.21
  • Bundler (+ version): webpack 5.73.0
  • Node.js version: v16.15.0
  • OS: MacOS

Description

I have next code:

const defaultStyle = css`
  color: red;
`;

const greenContentStyles = css`
  ${{
    [`&.${defaultStyle} .green`]: {
      display: "inline-block",
      border: "1px solid green",
    },
  }}
`;

I get error

ERROR in ./src/index.ts (../node_modules/css-loader/dist/cjs.js!../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./src/index.ts)
Module build failed (from ../node_modules/css-loader/dist/cjs.js):
CssSyntaxError

(2:11) /linaria-issue/app/src/index.ts Unknown word

  1 | .d2tf5um{color:red;}
> 2 | .g1gk6i3v{d2tf5um;}
    |           ^
  3 | .g2cbfky.s15xamdy .grey{display:inline-block;border:1px solid grey;}
  4 | 

It works with v3.0.0-beta.15
and I noticed it stop worked also

const test = css`padding-bottom: ${0}px`;

Reproducible Demo

repo for reproduce issue
https://github.com/Mavrin/linaria-issue

yarn install
cd app
yarn start
@Mavrin Mavrin 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 Jun 17, 2022
@github-actions github-actions bot added bundler: webpack 📦 Issue is related to webpack bundler and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Jun 17, 2022
@Anber Anber closed this as completed in 592b89b Jun 20, 2022
@Anber
Copy link
Collaborator

Anber commented Jun 20, 2022

Thank you @Mavrin for your report!
Both bugs were fixed in beta.22

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: webpack 📦 Issue is related to webpack bundler needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

2 participants