diff --git a/crates/next-core/src/next_config.rs b/crates/next-core/src/next_config.rs index ef603e73460d3d..8deef01e40a05b 100644 --- a/crates/next-core/src/next_config.rs +++ b/crates/next-core/src/next_config.rs @@ -141,10 +141,6 @@ pub struct NextConfig { compress: bool, eslint: EslintConfig, exclude_default_moment_locales: bool, - // this can be a function in js land - export_path_map: Option, - // this is a function in js land - generate_build_id: Option, generate_etags: bool, http_agent_options: HttpAgentConfig, on_demand_entries: OnDemandEntriesConfig, @@ -156,7 +152,11 @@ pub struct NextConfig { typescript: TypeScriptConfig, use_file_system_public_routes: bool, cache_components: Option, - webpack: Option, + // + // These are never used by Turbopack, and potentially non-serializable anyway: + // export_path_map: Option, + // generate_build_id: Option, + // webpack: Option, } #[turbo_tasks::value_impl] diff --git a/packages/next/src/build/swc/index.ts b/packages/next/src/build/swc/index.ts index c0ff835a8f49a8..cd8b2dfaa33b2d 100644 --- a/packages/next/src/build/swc/index.ts +++ b/packages/next/src/build/swc/index.ts @@ -852,11 +852,10 @@ function bindingToApi( // Avoid mutating the existing `nextConfig` object. NOTE: This is only a shallow clone. let nextConfigSerializable: Record = { ...nextConfig } - nextConfigSerializable.generateBuildId = - await nextConfigSerializable.generateBuildId?.() - - // TODO: these functions takes arguments, have to be supported in a different way + // These values are never read by Turbopack and are potentially non-serializable. nextConfigSerializable.exportPathMap = {} + nextConfigSerializable.generateBuildId = + nextConfigSerializable.generateBuildId && {} nextConfigSerializable.webpack = nextConfigSerializable.webpack && {} if (nextConfigSerializable.modularizeImports) {