diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 7ee3e3b83c41..a4bd5e6bba65 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -70,10 +70,10 @@ export function constructWebpackConfigFunction( addValueInjectionLoader(newConfig, userNextConfig, userSentryOptions); newConfig.module.rules.push({ - test: /node_modules\/@sentry\/nextjs/, + test: /node_modules[/\\]@sentry[/\\]nextjs/, use: [ { - loader: path.resolve(__dirname, 'loaders/sdkMultiplexerLoader.js'), + loader: path.resolve(__dirname, 'loaders', 'sdkMultiplexerLoader.js'), options: { importTarget: buildContext.nextRuntime === 'edge' ? './edge' : './client', }, @@ -133,7 +133,7 @@ export function constructWebpackConfigFunction( }, use: [ { - loader: path.resolve(__dirname, 'loaders/wrappingLoader.js'), + loader: path.resolve(__dirname, 'loaders', 'wrappingLoader.js'), options: { pagesDir: pagesDirPath, pageExtensionRegex,