We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e39d04 commit 547987aCopy full SHA for 547987a
packages/nextjs/src/config/loaders/wrappingLoader.ts
@@ -182,8 +182,10 @@ export default function wrappingLoader(
182
183
const componentTypeMatch = path.posix
184
.normalize(path.relative(appDir, this.resourcePath))
185
+ // Replace all backslashes with forward slashes (windows)
186
+ .replace(/\\/g, '/')
187
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
- .match(new RegExp(`/\\/?([^/]+)\\.(?:${pageExtensionRegex})$`));
188
+ .match(new RegExp(`(^|/)/?([^/]+)\\.(?:${pageExtensionRegex})$`));
189
190
if (componentTypeMatch && componentTypeMatch[1]) {
191
let componentType: ServerComponentContext['componentType'];
0 commit comments