From e3fb89fc0bb119aa99d123cfe09030d84f384122 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 4 Jul 2025 14:46:57 +0200 Subject: [PATCH 1/2] [devtool] inject styleTag instead of singletonStyleTag --- packages/next/next-devtools.webpack-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/next-devtools.webpack-config.js b/packages/next/next-devtools.webpack-config.js index 21fdd2d435d55..e60e715312479 100644 --- a/packages/next/next-devtools.webpack-config.js +++ b/packages/next/next-devtools.webpack-config.js @@ -97,7 +97,7 @@ module.exports = ({ dev, ...rest }) => { { loader: 'style-loader', options: { - injectType: 'singletonStyleTag', + injectType: 'styleTag', insert: require.resolve( './src/build/webpack/loaders/devtool/devtool-style-inject.js' ), From dc3ff14beaa3480d8c2cc134c226a90662c6c843 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sat, 5 Jul 2025 11:35:32 +0200 Subject: [PATCH 2/2] update comment --- packages/next/next-devtools.webpack-config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/next/next-devtools.webpack-config.js b/packages/next/next-devtools.webpack-config.js index e60e715312479..4e81bbeafea5e 100644 --- a/packages/next/next-devtools.webpack-config.js +++ b/packages/next/next-devtools.webpack-config.js @@ -97,6 +97,9 @@ module.exports = ({ dev, ...rest }) => { { loader: 'style-loader', options: { + // Explicitly set the injectType to 'styleTag' which is also the default behavior. + // We've experienced `singletonStyleTag` that the later updated styles not being applied. + // Keep using `styleTag` to ensure when new styles injected the style can also be updated. injectType: 'styleTag', insert: require.resolve( './src/build/webpack/loaders/devtool/devtool-style-inject.js'