Commit 002ddbe1 authored by Anthony Maki's avatar Anthony Maki Committed by JJ Kasper

Checks if object is not empty instead of whether the reference (object) is truthy (#7911)

* Checks if object is not empty instead of whether the reference (object) is truthy

* Update publicRuntimeConfig check
parent 728fe74e
...@@ -106,7 +106,11 @@ export default function loadConfig( ...@@ -106,7 +106,11 @@ export default function loadConfig(
: canonicalBase) || '' : canonicalBase) || ''
} }
if (userConfig.target === 'serverless' && userConfig.publicRuntimeConfig) { if (
userConfig.target === 'serverless' &&
userConfig.publicRuntimeConfig &&
Object.keys(userConfig.publicRuntimeConfig).length !== 0
) {
throw new Error( throw new Error(
'Cannot use publicRuntimeConfig with target=serverless https://err.sh/zeit/next.js/serverless-publicRuntimeConfig' 'Cannot use publicRuntimeConfig with target=serverless https://err.sh/zeit/next.js/serverless-publicRuntimeConfig'
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment