In the serverless
target environment next.config.js
is not loaded, so we don't support publicRuntimeConfig
.
Use config option env
to set build time variables like such:
// next.config.js
module.exports = {
env: {
special: 'value',
},
}
// pages/index.js
console.log(process.env.special) // value