Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
8460373c
Unverified
Commit
8460373c
authored
Apr 24, 2023
by
Jan Kaifer
Committed by
GitHub
Apr 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with instrumentation in a standalone build (#48615)
parent
39498d60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
27 deletions
+12
-27
index.ts
packages/next/src/build/index.ts
+2
-1
utils.ts
packages/next/src/build/utils.ts
+10
-1
tsconfig.json
test/e2e/instrumentation-hook/tsconfig.json
+0
-25
No files found.
packages/next/src/build/index.ts
View file @
8460373c
...
@@ -2113,7 +2113,8 @@ export default async function build(
...
@@ -2113,7 +2113,8 @@ export default async function build(
denormalizedAppPages
,
denormalizedAppPages
,
outputFileTracingRoot
,
outputFileTracingRoot
,
requiredServerFiles
.
config
,
requiredServerFiles
.
config
,
middlewareManifest
middlewareManifest
,
hasInstrumentationHook
)
)
})
})
}
}
...
...
packages/next/src/build/utils.ts
View file @
8460373c
...
@@ -1782,7 +1782,8 @@ export async function copyTracedFiles(
...
@@ -1782,7 +1782,8 @@ export async function copyTracedFiles(
appPageKeys
:
readonly
string
[]
|
undefined
,
appPageKeys
:
readonly
string
[]
|
undefined
,
tracingRoot
:
string
,
tracingRoot
:
string
,
serverConfig
:
{
[
key
:
string
]:
any
},
serverConfig
:
{
[
key
:
string
]:
any
},
middlewareManifest
:
MiddlewareManifest
middlewareManifest
:
MiddlewareManifest
,
hasInstrumentationHook
:
boolean
)
{
)
{
const
outputPath
=
path
.
join
(
distDir
,
'standalone'
)
const
outputPath
=
path
.
join
(
distDir
,
'standalone'
)
let
moduleType
=
false
let
moduleType
=
false
...
@@ -1888,6 +1889,7 @@ export async function copyTracedFiles(
...
@@ -1888,6 +1889,7 @@ export async function copyTracedFiles(
Log
.
warn
(
`Failed to copy traced files for
${
pageFile
}
`
,
err
)
Log
.
warn
(
`Failed to copy traced files for
${
pageFile
}
`
,
err
)
})
})
}
}
if
(
appPageKeys
)
{
if
(
appPageKeys
)
{
for
(
const
page
of
appPageKeys
)
{
for
(
const
page
of
appPageKeys
)
{
if
(
middlewareManifest
.
functions
.
hasOwnProperty
(
page
))
{
if
(
middlewareManifest
.
functions
.
hasOwnProperty
(
page
))
{
...
@@ -1900,6 +1902,13 @@ export async function copyTracedFiles(
...
@@ -1900,6 +1902,13 @@ export async function copyTracedFiles(
})
})
}
}
}
}
if
(
hasInstrumentationHook
)
{
await
handleTraceFiles
(
path
.
join
(
distDir
,
'server'
,
'instrumentation.js.nft.json'
)
)
}
await
handleTraceFiles
(
path
.
join
(
distDir
,
'next-server.js.nft.json'
))
await
handleTraceFiles
(
path
.
join
(
distDir
,
'next-server.js.nft.json'
))
const
serverOutputPath
=
path
.
join
(
const
serverOutputPath
=
path
.
join
(
outputPath
,
outputPath
,
...
...
test/e2e/instrumentation-hook/tsconfig.json
deleted
100644 → 0
View file @
39498d60
{
"compilerOptions"
:
{
"lib"
:
[
"dom"
,
"dom.iterable"
,
"esnext"
],
"allowJs"
:
true
,
"skipLibCheck"
:
true
,
"strict"
:
false
,
"forceConsistentCasingInFileNames"
:
true
,
"noEmit"
:
true
,
"incremental"
:
true
,
"esModuleInterop"
:
true
,
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
"resolveJsonModule"
:
true
,
"isolatedModules"
:
true
,
"jsx"
:
"preserve"
,
"plugins"
:
[
{
"name"
:
"next"
}
],
"strictNullChecks"
:
true
},
"include"
:
[
"next-env.d.ts"
,
"**/*.ts"
,
"**/*.tsx"
,
".next/types/**/*.ts"
],
"exclude"
:
[
"node_modules"
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment