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

[Nuxt/Vite] paths in types are absolute. Incompatible with WSL2 and WebStorm #1560

Closed
misaon opened this issue Aug 10, 2023 · 8 comments · Fixed by #1572
Closed

[Nuxt/Vite] paths in types are absolute. Incompatible with WSL2 and WebStorm #1560

misaon opened this issue Aug 10, 2023 · 8 comments · Fixed by #1572
Assignees
Labels
bug Something isn't working types

Comments

@misaon
Copy link

misaon commented Aug 10, 2023

Environment

Nitro 2.5.2
Node 18.17

Reproduction

nuxt/nuxt#21827 (comment)

Describe the bug

Why is the .nuxt folder and its dt.ts so inconsistent? Some places are relative imports, some places are absolute. WebStorm can't handle absolute paths in WSL2, so Nuxt 3 is unusable in that environment. It would make much more sense to me if all imports were relative.

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

I believe this is already resolved on the edge. Would you check?

@misaon misaon closed this as completed Aug 10, 2023
@misaon
Copy link
Author

misaon commented Aug 10, 2023

Much better but still contains bugs, reopen. 😞
nuxt/nuxt#21827 (comment)

@misaon misaon reopened this Aug 10, 2023
@danielroe danielroe self-assigned this Aug 11, 2023
@danielroe danielroe added bug Something isn't working types and removed pending triage labels Aug 11, 2023 — with Volta.net
@misaon
Copy link
Author

misaon commented Aug 11, 2023

@danielroe Do you think it would be good to have support for controlling tsconfig.server.json in hook prepare:types? Similar to tsconfig.json for Nuxt. Currently it can only be controlled via the typescript propert in: defineNuxtConfig > nitro > typescript > tsConfig.

https://github.com/nuxt/nuxt/blob/20efac7d57fd66283140a224d653d92b6e41676a/packages/nuxt/src/core/nitro.ts#L355C13-L355C23

@misaon
Copy link
Author

misaon commented Aug 15, 2023

@danielroe @pi0 I just tested and unfortunately it still doesn't work properly... 😞

Nuxt 3.7.0-28201370.c8cba7a0 with Nitro 2.6.0-28201391.6af6fd1

.nuxt/tsconfig.server.json: OK
.nuxt/types/nitro-imports.d.ts: BAD

// ...
export { defineCachedFunction, defineCachedEventHandler, cachedFunction, cachedEventHandler, useRuntimeConfig, useStorage, useNitroApp, defineNitroPlugin, nitroPlugin, defineRenderHandler, getRouteRules, useAppConfig, useEvent } from '/home/xxx/Projects/upscore/node_modules/.pnpm/nitropack-edge@2.6.0-28201391.6af6fd1/node_modules/nitropack-edge/dist/runtime';
// ...

@danielroe
Copy link
Member

@misaon Would you provide a reproduction?

@misaon
Copy link
Author

misaon commented Aug 15, 2023

@misaon Would you provide a reproduction?

nuxt/nuxt#21827 (comment)

@misaon
Copy link
Author

misaon commented Aug 16, 2023

@danielroe tested, works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants