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
How are you deploying your application? (if relevant)
next dev
Describe the Bug
On initial next dev, the source CSS files are processed as expected with the postcss.config.js configuration. This is evident by looking at the computed styles in devtools.
After making and saving changes to postcss.config.js and restarting the dev server, the computed styles do not reflect the changes made to the config file.
After saving a CSS file in a text editor, without even making changes to the file, and Next.js finishes compiling, usually the computed styles reflect the changes made to postcss.config.js (i.e. the source CSS file is processed as expected with the updated config file). Additionally, only that CSS file is processed with the updated postcss.config.js configuration; any other CSS file would have to be saved to update the computed styles.
Expected Behavior
After making changes to postcss.config.js and restarting the dev server, the output CSS should be processed with the updated PostCSS config file.
We encountered same issue. run start can read the real-time config file, whereas run dev keeps old params in postcss.config.js.
We tried to yarn remove next-server and reinstall it with yarn add next-server, then latest config become effective.
It seems that next-server keeps config cache itself.
Verify canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.2.5-canary.0
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next dev
Describe the Bug
On initial
next dev
, the source CSS files are processed as expected with the postcss.config.js configuration. This is evident by looking at the computed styles in devtools.After making and saving changes to postcss.config.js and restarting the dev server, the computed styles do not reflect the changes made to the config file.
After saving a CSS file in a text editor, without even making changes to the file, and Next.js finishes compiling, usually the computed styles reflect the changes made to postcss.config.js (i.e. the source CSS file is processed as expected with the updated config file). Additionally, only that CSS file is processed with the updated postcss.config.js configuration; any other CSS file would have to be saved to update the computed styles.
Expected Behavior
After making changes to postcss.config.js and restarting the dev server, the output CSS should be processed with the updated PostCSS config file.
Link to reproduction
https://github.com/ozzy1136/next.js-postcss-config-test
To Reproduce
git clone https://github.com/ozzy1136/next.js-postcss-config-test.git
cd next.js-postcss-config-test
npm install
npm run dev
<div>
with class testDiv^C
postcss.config.js
and change the value of "display-two-values" fromtrue
tofalse
postcss.config.js
npm run dev
pages/test.module.css
in text editor to process with updated PostCSS config fileThe text was updated successfully, but these errors were encountered: