File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/cloudflare/src/cli/build Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @opennextjs/cloudflare " : patch
3+ ---
4+
5+ define \_\_ filename globally
Original file line number Diff line number Diff line change @@ -136,10 +136,11 @@ export async function bundleServer(buildOpts: BuildOptions): Promise<void> {
136136 platform : "node" ,
137137 banner : {
138138 js : `
139- // __dirname is used by unbundled js files (which don't inherit the __dirname present in the define field)
139+ // Used by unbundled js files (which don't inherit the __dirname present in the define field)
140140// so we also need to set it on the global scope
141141// Note: this was hit in the next/dist/compiled/@opentelemetry/api module
142142globalThis.__dirname ??= "";
143+ globalThis.__filename ??= "";
143144
144145// Do not crash on cache not supported
145146// https://github.com/cloudflare/workerd/pull/2434
You can’t perform that action at this time.
0 commit comments