Skip to content

Commit 9ac2db8

Browse files
authored
fix(nextjs): return the correct result if file is missing (#1356)
1 parent 4877e9a commit 9ac2db8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nextjs/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function mergeWithExistingWebpackConfig(nextJsWebpackConfig, honeybadgerNextJsCo
6767
}
6868

6969
async function injectHoneybadgerConfigToEntry(originalEntry, projectDir: string, configType: NextJsRuntime) {
70+
const result = typeof originalEntry === 'function' ? await originalEntry() : { ...originalEntry }
7071
const hbConfigFile = getHoneybadgerConfigFile(projectDir, configType)
7172
if (!hbConfigFile) {
72-
return originalEntry
73+
return result
7374
}
7475

7576
const hbConfigFileRelativePath = `./${hbConfigFile}`
76-
const result = typeof originalEntry === 'function' ? await originalEntry() : { ...originalEntry }
7777
if (!Object.keys(result).length) {
7878
log('debug', `no entry points for configType[${configType}]`)
7979
}

0 commit comments

Comments
 (0)