Next.js: [9.5.3] Next/_error.jsx style from modules.scss not working

Created on 8 Sep 2020  ·  3Comments  ·  Source: vercel/next.js

Bug report

Describe the bug

since 9.5.3 ( in 9.5.2 works fine), the custom error page has broken styles

To Reproduce

using sass to styling

create custom error page _error.jsx (tsx in my case)

need to build to see the actual error page, and try to create an error
(yarn build && yarn start)

in the error page the global style works fine
but every module.scss is broken even for the main error page or for imported components

System information

  • sass: 1.26.10
  • OS: [macOS catalina || ubuntu 18.04 lts]
  • Version of Node.js: [v10.22.0 || v13.14.0]
bug 3 needs investigation

Most helpful comment

Hi, the same for me.
Here's example app to reproduce. I hope this helps you.

https://github.com/TasukuUno/repro-nextjs-16931

All 3 comments

Hi, the same for me.
Here's example app to reproduce. I hope this helps you.

https://github.com/TasukuUno/repro-nextjs-16931

In trying to debug this locally I can see that none of the paths provided to getCssLinks contain paths to css files from css modules:

https://github.com/vercel/next.js/blob/b2d1d87e7feed5535a05ec99d7558934dcbc82a5/packages/next/pages/_document.tsx#L160

Tracing back I can see this line in getDocumentFiles, which looks like it could be a good candidate for the cause of the problem:

https://github.com/vercel/next.js/blob/b2d1d87e7feed5535a05ec99d7558934dcbc82a5/packages/next/pages/_document.tsx#L59

but that line was changed 2 months ago in https://github.com/vercel/next.js/commit/9fcf39acd45966d8a6c362bec62e49a53dcd8581. Tracing back further we reach getPageFiles, the last change there was https://github.com/vercel/next.js/commit/3597978d7f121f11df99cd7cd757e1eb9868fff7 to "Modify low priority files in manifest", _possibly_ whatever is going on in here could be the cause? The intent is hard to determine but these amends _may_ have broken the contract for the data needed to get the CSS paths?

https://github.com/vercel/next.js/blob/3597978d7f121f11df99cd7cd757e1eb9868fff7/packages/next/next-server/server/render.tsx#L685-L701

Link here to the diff where the above was introduced in commit 3597978

Was this page helpful?
0 / 5 - 0 ratings

Related issues

formula349 picture formula349  ·  3Comments

sospedra picture sospedra  ·  3Comments

olifante picture olifante  ·  3Comments

swrdfish picture swrdfish  ·  3Comments

irrigator picture irrigator  ·  3Comments