You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nuxt 3.7 removed the baseUrl in .nuxt/tsconfig.json. However, tools like Vitest and Storybook rely on the baseUrl in order to resolve path aliases.
Adding the baseUrl back into the project's tsconfig.json at the root level breaks existing imports from #vue-router.
./nuxt/vue-router.d.ts contains the line: export * from 'vue-router', but it seems something isn't working correctly. Removing this file seems to remove the TypeScript issue.
The temporary solution for now is to create a new tsconfig.json file only for Vitest and Storybook. Only this config file contains the baseUrl.
Ideally, there would be a way to specify the baseUrl without breaking the import for vue-router. What would be the correct way to specify the baseUrl so that it works the same way as before the upgrade?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
baseUrl is removed as it is not recommended (and actually can cause issues):
This feature was designed for use in conjunction with AMD module loaders in the browser, and is not recommended in any other context. As of TypeScript 4.1, baseUrl is no longer required to be set when using paths.
Agree that storybook and vitest should be able to resolve the paths without the baseUrl, as it's no longer required. However, adding the baseUrl back into the tsconfig.json file should not break existing Nuxt imports, right?
What would be the correct way to import from #vue-router having the baseUrl in place? Because the path alias together with the baseUrl seem to point to the correct location (./nuxt/vue-router.d.ts).
Environment
Reproduction
npx nuxi@latest init my-app
tsconfig.json
at root level with the following content:#vue-router
:The following error message appears:
See Example on StackBlitz: https://stackblitz.com/edit/github-pzljlg. However, the error does not appear on StackBlitz, but only on a local project.
Describe the bug
Nuxt 3.7 removed the baseUrl in
.nuxt/tsconfig.json
. However, tools like Vitest and Storybook rely on the baseUrl in order to resolve path aliases.Adding the baseUrl back into the project's
tsconfig.json
at the root level breaks existing imports from#vue-router
../nuxt/vue-router.d.ts
contains the line:export * from 'vue-router'
, but it seems something isn't working correctly. Removing this file seems to remove the TypeScript issue.The temporary solution for now is to create a new
tsconfig.json
file only for Vitest and Storybook. Only this config file contains the baseUrl.Ideally, there would be a way to specify the baseUrl without breaking the import for
vue-router
. What would be the correct way to specify the baseUrl so that it works the same way as before the upgrade?Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: