You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Master CSS's AOT mode works by scanning source code and extracting potential class names to generate corresponding CSS rules.
Updating virtual CSS via webpack-virtual-modules works fine in Next.js 12 HMR, but in Next.js 13 appDir it is not refreshed properly by HMR.
In Next.js 12, external CSS assets that have changed are refreshed by updating the timestamp variable with ?t=xxx at the end of href to refresh the CSS modification.
Next.js 13 uses a special way to update external resources in the Network to refresh CSS changes. This method should be fine, but it does not capture changes in virtual modules correctly.
Expected Behavior
When a virtual CSS module is updated, Next.js' HMR should automatically refresh the corresponding target.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/master-co/css/tree/beta/examples/next.js
To Reproduce
This is a monorepo:
First, build the Master CSS:
Change to the Next.js 13 ( appDir ) directory:
Try to modify the class names of Master CSS syntax ( E.g. https://github.com/master-co/css/blob/beta/examples/next.js/app/page.tsx#L51 ):
Archive.
This issue has basically nothing to do with Master CSS and can be reproduced by writing a simple webpack virtual module.
Installation
Install Master CSS in Next.js
Related
webpack-virtual-modules
#44266Describe the Bug
Master CSS's AOT mode works by scanning source code and extracting potential class names to generate corresponding CSS rules.
Updating virtual CSS via webpack-virtual-modules works fine in Next.js 12 HMR, but in Next.js 13 appDir it is not refreshed properly by HMR.
In Next.js 12, external CSS assets that have changed are refreshed by updating the timestamp variable with
?t=xxx
at the end of href to refresh the CSS modification.Next.js 13 uses a special way to update external resources in the Network to refresh CSS changes. This method should be fine, but it does not capture changes in virtual modules correctly.
Expected Behavior
When a virtual CSS module is updated, Next.js' HMR should automatically refresh the corresponding target.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: