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

fix(next-plugin): build not outputting css on windows #1180

Merged
merged 3 commits into from
Sep 16, 2023

Conversation

syfxlin
Copy link
Contributor

@syfxlin syfxlin commented Sep 11, 2023

Fix #1086 #929

Next.js removes the resource matching query (!=!) and the inline loader (!virtual-file-loader.js?{}!), so you need to pass the virtual CSS file directly to noop.css, and then extract the virtual CSS file from noop.css via a loader like this:

import "noop.css?{ filename, source }"

This PR change is validated for Windows/Linux/macOS and can be used to output CSS normally in Next.js 13 & React Server Components.

References:

@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

🦋 Changeset detected

Latest commit: c3f3c82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vanilla-extract/next-plugin Patch
@vanilla-extract/webpack-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@askoufis askoufis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Fingers crossed this addresses all existing next.js issues.

I checked out your demos repo on windows and linux and can confirm that everything is working as expected. Also tested your next plugin with some of the reproductions in the next.js issues and they work too.

@mattcompiles mattcompiles merged commit 89224fe into vanilla-extract-css:master Sep 16, 2023
4 checks passed
@hazzo
Copy link

hazzo commented Sep 18, 2023

Did not fixed this #1152. Had to rollback and apply the patch with patch-package :S

@askoufis
Copy link
Contributor

askoufis commented Sep 18, 2023

Did not fixed this #1152. Had to rollback and apply the patch with patch-package :S

@hazzo The PR never stated that it would fix that issue. I was hopeful in the above comment that it might fix other issues, but it didn't. It seems that #1152 is caused by something else.

@syfxlin syfxlin deleted the syfxlin/next-plugin branch September 18, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Next.js 13 - Builds not outputting css on Windows
4 participants