rsnext/errors/serverless-publicRuntimeConfig.md
Tim Neutkens 3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02:00

464 B

Using publicRuntimeConfig with target set to serverless

Why This Error Occurred

In the serverless target environment next.config.js is not loaded, so we don't support publicRuntimeConfig.

Possible Ways to Fix It

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