File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
packages/next/src/server/dev Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -432,17 +432,14 @@ export function getOverlayMiddleware({
432
432
433
433
let openEditorResult
434
434
if ( isAppRelativePath ) {
435
- const relativeFilePath = ( searchParams . get ( 'file' ) || '' ) . replace (
436
- '/' ,
437
- path . sep
438
- )
439
- const filePath = path . join (
435
+ const relativeFilePath = searchParams . get ( 'file' ) || ''
436
+ const absoluteFilePath = path . join (
440
437
projectPath ,
441
438
'app' ,
442
439
isSrcDir ? 'src' : '' ,
443
440
relativeFilePath
444
441
)
445
- openEditorResult = await openFileInEditor ( filePath , 1 , 1 )
442
+ openEditorResult = await openFileInEditor ( absoluteFilePath , 1 , 1 )
446
443
} else {
447
444
const frame = createStackFrame ( searchParams )
448
445
if ( ! frame ) return middlewareResponse . badRequest ( res )
Original file line number Diff line number Diff line change @@ -581,17 +581,14 @@ export function getOverlayMiddleware(options: {
581
581
let openEditorResult
582
582
const isAppRelativePath = searchParams . get ( 'isAppRelativePath' ) === '1'
583
583
if ( isAppRelativePath ) {
584
- const relativeFilePath = ( searchParams . get ( 'file' ) || '' ) . replace (
585
- '/' ,
586
- path . sep
587
- )
588
- const filePath = path . join (
584
+ const relativeFilePath = searchParams . get ( 'file' ) || ''
585
+ const absoluteFilePath = path . join (
589
586
rootDirectory ,
590
587
'app' ,
591
588
isSrcDir ? 'src' : '' ,
592
589
relativeFilePath
593
590
)
594
- openEditorResult = await openFileInEditor ( filePath , 1 , 1 )
591
+ openEditorResult = await openFileInEditor ( absoluteFilePath , 1 , 1 )
595
592
} else {
596
593
// frame files may start with their webpack layer, like (middleware)/middleware.js
597
594
const filePath = path . resolve (
You can’t perform that action at this time.
0 commit comments