From a78f88daac0785b3c6591c061df42fbf544303de Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Thu, 28 May 2026 09:10:22 -0400 Subject: [PATCH] fix: remove dead `logModulesWithDynamicImports` This was oprhaned years ago by https://github.com/netlify/build/commit/ef4ab12c3. --- packages/build/src/log/messages/core_steps.js | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/packages/build/src/log/messages/core_steps.js b/packages/build/src/log/messages/core_steps.js index f417d9236a..dd714d27d5 100644 --- a/packages/build/src/log/messages/core_steps.js +++ b/packages/build/src/log/messages/core_steps.js @@ -27,9 +27,6 @@ export const logBundleResults = ({ logs, results = [] }) => { const resultsWithWarnings = results.filter( ({ bundler, bundlerWarnings }) => bundler === 'esbuild' && bundlerWarnings && bundlerWarnings.length !== 0, ) - const modulesWithDynamicImports = [ - ...new Set(results.flatMap((result) => result.nodeModulesWithDynamicImports || [])), - ] if (resultsWithErrors.length !== 0) { logBundleResultFunctions({ @@ -48,10 +45,6 @@ export const logBundleResults = ({ logs, results = [] }) => { error: false, }) } - - if (modulesWithDynamicImports.length !== 0) { - logModulesWithDynamicImports({ logs, modulesWithDynamicImports }) - } } export const logFunctionsNonExistingDir = function (logs, relativeFunctionsSrc) { @@ -144,25 +137,6 @@ export const logDbMigrations = function ({ logs, migrations, srcDir }) { logArray(logs, migrations, { indent: false }) } -const logModulesWithDynamicImports = ({ logs, modulesWithDynamicImports }) => { - const externalNodeModules = modulesWithDynamicImports.map((moduleName) => `"${moduleName}"`).join(', ') - - logWarningSubHeader(logs, `The following Node.js modules use dynamic expressions to include files:`) - logArray(logs, modulesWithDynamicImports) - log( - logs, - `\n Because files included with dynamic expressions aren't bundled with your serverless functions by default, - this may result in an error when invoking a function. To resolve this error, you can mark these Node.js - modules as external in the [functions] section of your \`netlify.toml\` configuration file: - - [functions] - external_node_modules = [${externalNodeModules}] - - Visit https://ntl.fyi/dynamic-imports for more information. - `, - ) -} - export const logSecretsScanSkipMessage = function (logs, msg) { log(logs, msg, { color: THEME.warningHighlightWords }) }