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
Non-relative paths are not allowed when 'baseUrl' is not set. Typescript v5.2.2 #23157
Comments
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
have the same issue,when yarn build (on nuxt layer)
|
Same issue here. Happened for me after upgrading from 3.6.5 to 3.7.3. And the error message is also interesting that there is no reference to a file, it says
|
The https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz?file=.nuxt%2Ftsconfig.json |
Okay in this this PR , it removed for dev env support. I am guessing some dependencies still need |
I found my issue, I defined an alias Hope this helps |
See this kevinmarrec/nuxt-pwa-module#109 |
To override this temporarily, in your {
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"paths": {
"#pwa": [
"./.nuxt/types/pwa"
],
}
}
} |
Just sharing thoughts, I might be wrong again too.I stand corrected, applying the above solution caused some weird behavior in typescript in my project, leading to some variables being set as type The proper method to override the paths in ./.nuxt/tsconfig.json as per https://nuxt.com/docs/guide/concepts/typescript#nuxttsconfigjson is to use alias:{
"#pwa": "./.nuxt/types/pwa"
}, |
This didn't work for me after adding the alias to |
Here is working workaround in import { defineNuxtModule } from '@nuxt/kit';
...
modules: [
'@kevinmarrec/nuxt-pwa',
// Add this after pwa module
defineNuxtModule({
setup(_, nuxt) {
nuxt.hook('prepare:types', ({ tsConfig }) => {
// @ts-ignore
tsConfig.compilerOptions.paths['#pwa'] = ['./.nuxt/types/pwa'];
});
},
}),
], |
Cannot find name 'defineNuxtModule'. |
import { defineNuxtModule } from '@nuxt/kit'; |
This comment was marked as off-topic.
This comment was marked as off-topic.
To anyone experiencing the bug: To make sure we can have a look it is necessary to add a reproduction as described in #23157 (comment) |
I also experienced the bug (with unchanged code from a working version so I could not create a reproduction) and found that deleting the |
Hi,
then To correct the problem I added baseUrl as follows :
|
Environment
Reproduction
Upgrade nuxt project to use
typescript@5.2.2
Describe the bug
Since upgrading to
typescript@5.2.2
I get the following error in the self-generatedtsconfig.json
Additional context
The root cause of the issue is actually due to the "#pwa" types path in the auto-generated
ts-config.json
Logs
No response
The text was updated successfully, but these errors were encountered: