next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Astroturf css template broken after v9.0.3

Open vinipace opened this issue 7 years ago • 2 comments

Bug report

Describe the bug

Using css template to define styles with astroturf stopped working in [email protected]

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to example with-astroturf
  2. Change styled.button to:
const s = css`
  .button {
    color: black;
    border: 1px solid black;
    background-color: white;

    &.primary {
      color: blue;
      border: 1px solid blue;
    }

    &.color-green {
      color: green;
    }
  }
`
  1. See error
[ wait ]  compiling ...
[ error ] ./pages/index-s.css
AstroturfLoaderError: /Users/murdock/lab/sandbox/next.js/examples/with-astroturf/pages/index-s.css: Unexpected token (2:2)

  1 | 
> 2 |   .button {
    |   ^
  3 |     color: black;
  4 |     border: 1px solid black;
  5 |     background-color: white;
ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/astroturf/loader.js):
AstroturfLoaderError: /Users/murdock/lab/sandbox/next.js/examples/with-astroturf/pages/index-s.css: Unexpected token (2:2)

Expected behavior

Styles should be compiled without any errors

Screenshots

image

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of Next.js: v9.0.5

Additional context

  • I didn't test in a project without Typescript
  • At version v9.0.2 it was working with no errors

vinipace avatar Aug 26 '19 18:08 vinipace

Closing as no pr was opened.

timneutkens avatar Jan 02 '20 22:01 timneutkens

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

balazsorban44 avatar Jan 30 '22 18:01 balazsorban44