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

Styled-JSX HMR failed in Next 6.0.0 #4335

Closed
williamli opened this issue May 11, 2018 · 2 comments · May be fixed by NOUIY/next.js#287, MaxMood96/next.js#359, jackromo888/next.js#164 or CALISOULB/next.js#477
Closed

Comments

@williamli
Copy link
Contributor

setup a new project with

mkdir hello-next
cd hello-next
npm init -y
npm install --save react react-dom next
mkdir pages

add a new index.js page

export default () =>
  <div>
    Hello world
    <p>scoped!</p>
    <style jsx>{`
      p {
        color: blue;
      }
      div {
        background: red;
      }
      @media (max-width: 600px) {
        div {
          background: blue;
        }
      }
    `}</style>
    <style global jsx>{`
      body {
        background: black;
      }
    `}</style>
  </div>

change the style and save.

you will then be greeted by style remove / update errors

StyleSheetRegistry: styleId: `jsx-803111306` not found.
Error: StyleSheetRegistry: styleId: `jsx-803111306` not found.
    at invariant (node_modules/styled-jsx/dist/stylesheet-registry.js:267:0)
    at StyleSheetRegistry.remove (node_modules/styled-jsx/dist/stylesheet-registry.js:118:0)
    at StyleSheetRegistry.update (node_modules/styled-jsx/dist/stylesheet-registry.js:139:0)

@williamli
Copy link
Contributor Author

williamli commented May 11, 2018

should be a duplicate of #4273 and #4299

is there any way to patch this problem without running my project in next@canary?

@timneutkens
Copy link
Member

6.0.1 will be out soon, until then use next@canary

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.