-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Labels
please add a complete reproductionPlease add a complete reproduction.Please add a complete reproduction.
Description
Bug report
Using Next.js v9.0.3
Describe the bug
During development, the public runtime config is empty, even though publicRuntimeConfig is set in the config file.

However, the config is available when the project is built and running on production.
To Reproduce
- Add publicRuntimeConfig in the
next.config.jsfile.
// for example
publicRuntimeConfig: {
API_URL: 'http://localhost:3001/api'
}
- Open browser console and
window.__NEXT_DATA__.runtimeConfigas shown in the image above. - It will return empty object
{}, even though public runtime config should have API_URL value.
Expected behavior
publicRuntimeConfig should be available both in development and production.
System information
- Version of Next.js: 9.0.3
Metadata
Metadata
Assignees
Labels
please add a complete reproductionPlease add a complete reproduction.Please add a complete reproduction.