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

Everything from Nuxt 3 Runtime Config is unknown #110

Open
qkqk opened this issue Nov 21, 2024 · 2 comments
Open

Everything from Nuxt 3 Runtime Config is unknown #110

qkqk opened this issue Nov 21, 2024 · 2 comments

Comments

@qkqk
Copy link

qkqk commented Nov 21, 2024

With the latest version 0.7.0 the Nuxt 3 build fails, because all types from Runtime Config are unknown, removing the nuxt-applicationinsights from nuxt.config modules fixes this.

Also downgrading the lib to 0.6.0 resolves this.

Error example:

error TS2322: Type '{ 'server-token': unknown; }' is not assignable to type 'HeadersInit | undefined'.
Types of property ''server-token'' are incompatible.
Type 'unknown' is not assignable to type 'string | undefined'.

26 headers: {
~~~~~~~

@huang-julien
Copy link
Owner

Hello can you provide a reproduction please ?

you can use https://stackblitz.com/edit/nuxt-starter-uvbiaa?file=README.md .

I need at least the package.json with the lockfile n order to debug it

@qkqk
Copy link
Author

qkqk commented Nov 25, 2024

Yes, here's the reproduction: https://stackblitz.com/edit/nuxt-starter-geb6an?file=server%2Fplugins%2Fmongodb.ts

Steps:

  1. Create .env file and add MONGODB_URI=mongodb+srv into it
  2. See the "server/plugins/mongodb.ts" file - the env from useRuntimeConfig() is unknown

Then:
4. Remove 'nuxt-applicationinsights' from nuxt.config.ts modules
5. Go back to "server/plugins/mongodb.ts" file - the env from useRuntimeConfig() is now a string as it should be

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

No branches or pull requests

2 participants