Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeConfigs not picked up #10385

Closed
gurkerl83 opened this issue Feb 2, 2020 · 3 comments · Fixed by #10386
Closed

RuntimeConfigs not picked up #10385

gurkerl83 opened this issue Feb 2, 2020 · 3 comments · Fixed by #10386
Milestone

Comments

@gurkerl83
Copy link
Contributor

Bug report

The following commit makes publicRuntimeConfig and serverRuntimeConfig available to serverless target afc278f.

Describe the bug

Now completes the build but fails on calling the application. I get the following error when executing the application. Using now@canary in now.json.

Cannot destructure property publicRuntimeConfig of 'undefined' or 'null'.

Tested both publicRuntimeConfig and serverRuntimeConfig on a my local machine with 9.2.2-canary.6. Here I get an Internal Server Error (500). I know not really helpful.

To Reproduce

I can not provide a repo at the moment just the branch of trying runtimeConfig on a serverless target.
Here is the branch, look at the last commit.

https://github.com/project-millipede/millipede-docs/tree/Next-FS-Test

Expected behavior

A clear and concise description of what you expected to happen.

An identical behaviour of runtime config how its currently supported in server target and described in the documentation here.

https://github.com/zeit/next.js/blob/f24aa41440b57a4c9a289ccc1fdca223f6b3a0dd/docs/api-reference/next.config.js/runtime-configuration.md

System information

Chrome
Next: 9.2.2-canary.6
Now: canary

@ijjk
Copy link
Member

ijjk commented Feb 2, 2020

Hi, thanks for giving this a try so quickly. It looks like you were using the runtime configs in a file imported by _app which is definitely supported in server mode but is not in the initial commit you mentioned as we were setting the runtime config before importing the page's component.

I opened a follow-up PR here to make sure the config is set before the other imports also which should match the runtime config behavior for server mode

@gurkerl83
Copy link
Contributor Author

I was curious to see if the commit actually provides the feature that was mentioned as the title. After taking a closer look at the commit, it was somehow clear that this was the first step in creating the variables, and that more commits would follow to deliver them correctly. In any case, thank you very much for the quick response and the timely provision of the appropriate function. I will continue to test the function in the next few days and give feedback if problems occur.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants