Skip to content

Commit

Permalink
fix(next-export): cors errors due to wrong crossorigin default value
Browse files Browse the repository at this point in the history
  • Loading branch information
ild0tt0re committed Nov 10, 2023
1 parent 7966eaf commit 175bbc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/next/src/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ export async function exportAppImpl(
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
// Exported pages do not currently support dynamic HTML.
supportsDynamicHTML: false,
crossOrigin: nextConfig.crossOrigin || '',
crossOrigin:
nextConfig.crossOrigin === false ? undefined : nextConfig.crossOrigin,
optimizeCss: nextConfig.experimental.optimizeCss,
nextConfigOutput: nextConfig.output,
nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,
Expand Down
7 changes: 4 additions & 3 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,10 @@ export default abstract class Server<ServerOptions extends Options = Options> {
distDir: this.distDir,
serverComponents: this.enabledDirectories.app,
enableTainting: this.nextConfig.experimental.taint,
crossOrigin: this.nextConfig.crossOrigin
? this.nextConfig.crossOrigin
: undefined,
crossOrigin:
this.nextConfig.crossOrigin === false
? undefined
: this.nextConfig.crossOrigin,
largePageDataBytes: this.nextConfig.experimental.largePageDataBytes,
// Only the `publicRuntimeConfig` key is exposed to the client side
// It'll be rendered as part of __NEXT_DATA__ on the client side
Expand Down

0 comments on commit 175bbc3

Please sign in to comment.