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

[9.5.3] Next/_error.jsx style from modules.scss not working #16931

Closed
vdiazroa opened this issue Sep 8, 2020 · 4 comments · Fixed by #17301
Closed

[9.5.3] Next/_error.jsx style from modules.scss not working #16931

vdiazroa opened this issue Sep 8, 2020 · 4 comments · Fixed by #17301

Comments

@vdiazroa
Copy link

vdiazroa commented Sep 8, 2020

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]
@Timer Timer modified the milestones: iteration 9, 9.x.x Sep 8, 2020
@TasukuUno
Copy link
Contributor

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

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

@JamieMason
Copy link

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:

getCssLinks(files: DocumentFiles): JSX.Element[] | null {

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

pathname !== '/_error' ? getPageFiles(buildManifest, pathname) : []

but that line was changed 2 months ago in 9fcf39a. Tracing back further we reach getPageFiles, the last change there was 3597978 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?

if (page in filteredBuildManifest.pages) {
filteredBuildManifest = {
...filteredBuildManifest,
pages: {
...filteredBuildManifest.pages,
[page]: [
...filteredBuildManifest.pages[page],
...filteredBuildManifest.lowPriorityFiles.filter((f) =>
f.includes('_buildManifest')
),
],
},
lowPriorityFiles: filteredBuildManifest.lowPriorityFiles.filter(
(f) => !f.includes('_buildManifest')
),
}
}

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

@JamieMason
Copy link

There is a workaround here: #16784 (comment)

@Timer Timer added good first issue Easy to fix issues, good for newcomers and removed good first issue Easy to fix issues, good for newcomers labels Nov 16, 2020
@Timer Timer removed this from the 10.x.x milestone Nov 16, 2020
@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants