Skip to content

Commit 040a627

Browse files
fix: next 10.0.8 changes loadConfig to be async (#105)
* fix: 10.0.8 changes loadConfig to be async * wip: make literally everything async bc loadConfig * wip: fix i18n bug, got 10.0.6 tests to pass * wip: NoN tests pass on 10.0.8 but plugin test chdir fixture issue * Fix bug with Jest * fix: delete TO-DO Co-authored-by: ehmicky <[email protected]>
1 parent 2ca947d commit 040a627

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+568
-627
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
}

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = {
5454

5555
await makeDir(PUBLISH_DIR)
5656

57-
nextOnNetlify({ functionsDir: FUNCTIONS_SRC, publishDir: PUBLISH_DIR })
57+
await nextOnNetlify({ functionsDir: FUNCTIONS_SRC, publishDir: PUBLISH_DIR })
5858
},
5959
}
6060

0 commit comments

Comments
 (0)