Skip to content

Commit b46de96

Browse files
committed
fix: 10.0.8 changes loadConfig to be async
1 parent b5c9001 commit b46de96

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

helpers/doesNotNeedPlugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const doesNotNeedPlugin = async ({ netlifyConfig, packageJson, utils }) => {
1313
return (
1414
isStaticExportProject({ build, scripts }) ||
1515
doesSiteUseNextOnNetlify({ packageJson }) ||
16-
!hasCorrectNextConfig({ nextConfigPath, failBuild: utils.build.failBuild })
16+
!(await hasCorrectNextConfig({ nextConfigPath, failBuild: utils.build.failBuild }))
1717
)
1818
}
1919

helpers/hasCorrectNextConfig.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require('path')
22

33
// Checks if site has the correct next.cofig.js
4-
const hasCorrectNextConfig = ({ nextConfigPath, failBuild }) => {
4+
const hasCorrectNextConfig = async ({ nextConfigPath, failBuild }) => {
55
// In the plugin's case, no config is valid because we'll make it ourselves
66
if (nextConfigPath === undefined) return true
77

@@ -14,7 +14,7 @@ const hasCorrectNextConfig = ({ nextConfigPath, failBuild }) => {
1414
const acceptableTargets = ['serverless', 'experimental-serverless-trace']
1515
let nextConfig
1616
try {
17-
nextConfig = loadConfig(PHASE_PRODUCTION_BUILD, path.resolve('.'))
17+
nextConfig = await loadConfig(PHASE_PRODUCTION_BUILD, path.resolve('.'))
1818
} catch (error) {
1919
return failBuild('Error loading your next.config.js.', { error })
2020
}

0 commit comments

Comments
 (0)