File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/nextjs/src/config/loaders Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,15 @@ export default function wrappingLoader(
203
203
}
204
204
205
205
if ( sentryConfigFilePath ) {
206
- templateCode = `import "${ sentryConfigFilePath } ";` . concat ( templateCode ) ;
206
+ let importPath = sentryConfigFilePath ;
207
+
208
+ // absolute paths do not work with Windows
209
+ // https://github.com/getsentry/sentry-javascript/issues/8133
210
+ if ( path . isAbsolute ( importPath ) ) {
211
+ importPath = path . relative ( path . dirname ( this . resourcePath ) , importPath ) ;
212
+ }
213
+
214
+ templateCode = `import "${ importPath . replace ( / \\ / g, '/' ) } ";\n` . concat ( templateCode ) ;
207
215
}
208
216
} else if ( wrappingTargetKind === 'middleware' ) {
209
217
templateCode = middlewareWrapperTemplateCode ;
You can’t perform that action at this time.
0 commit comments