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(
203203 }
204204
205205 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 ) ;
207215 }
208216 } else if ( wrappingTargetKind === 'middleware' ) {
209217 templateCode = middlewareWrapperTemplateCode ;
You can’t perform that action at this time.
0 commit comments