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

RuntimeConfig does not display proper environment variable hint when already using UPPER_SNAKE_CASE #23246

Closed
Aareksio opened this issue Sep 15, 2023 · 4 comments · Fixed by #23696

Comments

@Aareksio
Copy link
Contributor

Aareksio commented Sep 15, 2023

Environment


  • Operating System: Linux
  • Node Version: v16.20.0
  • Nuxt Version: 3.7.3
  • CLI Version: 3.8.4
  • Nitro Version: 2.6.3
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: devtools, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-uezcgs?file=nuxt.config.ts

Describe the bug

Hint reads:

You can override this value at runtime with NUXT_PUBLIC_A_PP_NAME_S

Should be:

You can override this value at runtime with NUXT_PUBLIC_APP_NAMES

Additional context

export default defineNuxtConfig({
  runtimeConfig: {
    public: {
      APP_NAMES: 'xyz'
    }
  }
})

Environment variable NUXT_PUBLIC_APP_NAMES is properly respected. The issue concerns the documentation exclusively.

Logs

No response

@stackblitz
Copy link

stackblitz bot commented Sep 15, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Aareksio Aareksio changed the title RuntimeConfig typescript hint displays incorrect path RuntimeConfig does not display proper environment variable hint when already using UPPER_SNAKE_CASE Sep 16, 2023
@luc122c
Copy link
Contributor

luc122c commented Oct 16, 2023

It seems to be an issue with the UpperSnakeCase type. I think i've figured out where the problem comes from. I'll open a PR to fix and add some more tests.

Playground link

@pi0
Copy link
Member

pi0 commented Oct 16, 2023

Nice find @luc122c ❤️

@luc122c
Copy link
Contributor

luc122c commented Oct 16, 2023

I'm not quite sure how to run these tests. None of the test scripts in package.json seem to run them and I only see ./fixtures/basic being setup, not ./fixtures/basic-test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants