Giter Site home page Giter Site logo

Comments (7)

SukkaW avatar SukkaW commented on June 16, 2024 4

Thank you so much, the new version of the plugin works perfectly with both components (Server and Client).

Thanks for your feedback!

In the meantime, I will keep the issue open. Once Next.js has fixed that part of its internal implementation, I will add a deprecation/removal warning in style9-webpack/next-appdir (to inform users to switch back to style9-webpack/next), and then I will close the issue.

from style9-webpack.

Dwlad90 avatar Dwlad90 commented on June 16, 2024 1

@SukkaW
Thank you so much, the new version of plugin works perfectly with both components (Server and Client).

Here is a very basic reproduction with [email protected]:
https://codesandbox.io/p/github/Dwlad90/elegant-cloud-zckzqc/main

from style9-webpack.

SukkaW avatar SukkaW commented on June 16, 2024

@Dwlad90

Would you like to try the following patch to see if it works? (only the patch for next is needed).

https://gist.github.com/bizarre/825cab8224c28e93ff1a3933642f9271

Contexts:

- vanilla-extract-css/vanilla-extract#929
- vanilla-extract-css/vanilla-extract#929 (comment)

Never mind, the patch doesn't work, and the issue might not be related to Next.js.

Would you like to share your reproduction to a GitHub repo? I might want to try it out locally.


Update

It looks like the server components' styles never get extracted and collected.


Update

I am not sure, but it seems like Next.js just somehow gets rid of the virtualFileLoader when processing style9 generated CSS on the server side,

from style9-webpack.

SukkaW avatar SukkaW commented on June 16, 2024

@Dwlad90

After discussing with @shuding (Next.js Team Member), he is able to pinpoint where Next.js drop all the loaders:

https://github.com/vercel/next.js/blob/3a9bfe60d228fc2fd8fe65b76d49a0d21df4ecc7/packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts#L425-L429

Here, only path and query are passed down, and all loaders are ignored.

In the meantime, I am creating a workaround for this. I have created a workaround. You can upgrade to [email protected] or newer, and use style9-webpack/next-appdir (instead of style9-webpack/next) in your Next.js config.

from style9-webpack.

Dwlad90 avatar Dwlad90 commented on June 16, 2024

Hey @SukkaW,
CSS extraction on server components stopped working in the NextJS version @(13.5.4).
Could you please check what happened?

Here is a basic reproduction:
https://codesandbox.io/p/github/Dwlad90/elegant-cloud-zckzqc/draft/goofy-dawn

Update:
It works fine with the latest version of style9-webpack (0.5.2), thanks.

from style9-webpack.

SukkaW avatar SukkaW commented on June 16, 2024

Could you please check what happened?

Update:
It works fine with the latest version of style9-webpack (0.5.2), thanks.

Actually, the issue should have happened since Next.js 13.4.19, when Next.js removes the experimental.appDir (appDir is now enabled by default).

Here is the related fix that has landed in [email protected]: 35f4e31

from style9-webpack.

Dwlad90 avatar Dwlad90 commented on June 16, 2024

Could you please check what happened?

Update:
It works fine with the latest version of style9-webpack (0.5.2), thanks.

Actually, the issue should have happened since Next.js 13.4.19, when Next.js removes the experimental.appDir (appDir is now enabled by default).

Here is the related change that has landed in [email protected]: 35f4e31

This actually happened after updating Next JS from "13.4.19" to "13.5.4". The previous version didn't have this problem.

from style9-webpack.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.