File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " open-next " : patch
3
+ ---
4
+
5
+ Fix "Cannot find package 'next'"
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ export async function build() {
13
13
// Pre-build validation
14
14
printVersion ( ) ;
15
15
checkRunningInsideNextjsApp ( ) ;
16
- setStandaloneBuildMode ( ) ;
17
16
const { root : monorepoRoot , packager } = findMonorepoRoot ( ) ;
18
17
19
18
// Build Next.js app
20
19
printHeader ( "Building Next.js app" ) ;
20
+ setStandaloneBuildMode ( monorepoRoot ) ;
21
21
await buildNextjsApp ( packager ) ;
22
22
23
23
// Generate deployable bundle
@@ -64,9 +64,11 @@ function findMonorepoRoot() {
64
64
return { root : appPath , packager : "npm" as const } ;
65
65
}
66
66
67
- function setStandaloneBuildMode ( ) {
68
- // Equivalent to setting `target: ' standalone' ` in next.config.js
67
+ function setStandaloneBuildMode ( monorepoRoot : string ) {
68
+ // Equivalent to setting `target: " standalone" ` in next.config.js
69
69
process . env . NEXT_PRIVATE_STANDALONE = "true" ;
70
+ // Equivalent to setting `experimental.outputFileTracingRoot` in next.config.js
71
+ process . env . NEXT_PRIVATE_OUTPUT_TRACE_ROOT = monorepoRoot ;
70
72
}
71
73
72
74
function buildNextjsApp ( packager : "npm" | "yarn" | "pnpm" ) {
You can’t perform that action at this time.
0 commit comments