#Project-wide Typescript disabled
25 messages · Page 1 of 1 (latest)
It sounds like you're encountering issues with TypeScript performance and IntelliSense in your Nuxt project, likely due to a large or problematic file/folder in your workspace. This is a known pain point, especially when the TypeScript server is overwhelmed by too many files or directories that shouldn't be included in type checking.
Key points and suggestions from the knowledge sources:
-
Large or Non-Essential Files: If your project root contains many resource, temp, or test files, Vite (used by Nuxt 3) and the TypeScript server may try to process them, leading to performance issues and even errors. Moving non-essential files out of the root directory can help. If you need to keep them, you should explicitly tell Nuxt/Vite/TypeScript to ignore them using the
ignoreoption in yournuxt.configor by configuring yourtsconfig.jsonexcludes. Users have reported that this approach resolved their issues with file handle exhaustion and TypeScript server crashes GitHub Issue: EBADF error with Nuxt 3 and Vite. -
Excluding Folders in tsconfig.json: Nuxt generates a
.nuxt/tsconfig.jsonwith sensible defaults. You can extend this in your roottsconfig.json, but be careful not to overwrite important options likepaths, as this can break module resolution. Instead, use thealiasproperty innuxt.configfor custom paths. If you need to exclude folders, you can add anexcludearray in yourtsconfig.json, but remember that Nuxt's generated config is authoritative for most settings Nuxt Directory Structure: tsconfig.json.
-
Performance and Exclusions: Recent Nuxt updates have specifically excluded directories like
.datafrom type-checking for performance reasons, so if you have large data or generated folders, ensure they're excluded from your TypeScript project as well Nuxt PR: Exclude .data directory. -
VSCode and Volar: If you're using VSCode, make sure you have the Volar extension installed and that your
<script>tags in Vue files uselang="ts". Missing this can cause TypeScript errors and loss of IntelliSense Stack Overflow: Intellisense errors in SFC files.
What you can try:
-
Move or Exclude Large/Non-Essential Folders: Move large folders (like test data, temp files, or generated assets) out of your project root, or add them to the
excludearray in yourtsconfig.json. -
Use the
ignoreOption in Nuxt: You can use theignoreoption in yournuxt.configto tell Nuxt (and Vite) to ignore certain files or directories. This has been confirmed to work for similar issues GitHub Issue: EBADF error with Nuxt 3 and Vite:// nuxt.config.ts export default defineNuxtConfig({ ignore: ['**/your-large-folder/**'] }) -
Check Your tsconfig.json: Make sure your root
tsconfig.jsonextends from./.nuxt/tsconfig.jsonand only customizes what you need. Avoid overwritingpathsand other critical options unless necessary Nuxt Directory Structure: tsconfig.json. -
Restart VSCode and TypeScript Server: After making changes, restart VSCode and the TypeScript server to ensure the new settings are picked up.
If you've already tried these steps and the problem persists, there may be a specific file or folder causing the issue. Try temporarily moving folders out of your project root one by one to identify the culprit.
If you need more targeted help, please provide the structure of your project and the contents of your tsconfig.json and nuxt.config.ts.
If you need more details on configuring exclusions or the ignore option, let me know!
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@gaunt rapids Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Reason: Mass mention
Reason: Mass mention
Reason: Mass mention
Can someone help?
@glass falcon
Seems like it's the .nuxt file thats causing this, but I already excluded it on my tsconfig:
{
"extends": "./.nuxt/tsconfig.json",
"exclude": ["/node_modules", "/.nuxt", "/dist", "/.test.", "**/.spec."]
}
Let me check the knowledge base for you again. One moment! :books:
Based on the knowledge sources, excluding the .nuxt directory in your root tsconfig.json will not have the intended effect, because Nuxt generates a .nuxt/tsconfig.json file and expects your root tsconfig.json to extend it. The generated .nuxt/tsconfig.json is authoritative and is designed to provide the correct TypeScript setup for your project, including all necessary paths and aliases.
If you add an exclude in your root tsconfig.json, it does not override or affect the files included by .nuxt/tsconfig.json. In fact, the documentation explicitly warns that options like paths and other settings in your root tsconfig.json will overwrite, not merge with, the generated config, which can break module resolution and type support. The recommended way to customize paths or aliases is through the alias property in your nuxt.config, not by editing tsconfig.json directly. There is no mention in the knowledge sources that excluding .nuxt in your root tsconfig.json will prevent TypeScript or your IDE from processing it, since Nuxt expects it to be included for type support and auto-imports to work correctly Nuxt Directory Structure: tsconfig.json Auto-generated Types.
If .nuxt is causing performance issues, this is likely due to the size or complexity of the generated files, but excluding it in tsconfig.json is not supported or recommended by Nuxt. The knowledge sources do not provide a supported way to exclude .nuxt from type checking or IntelliSense, as it is essential for Nuxt's type system to function.
Summary:
You cannot safely exclude .nuxt from your TypeScript project using tsconfig.json without breaking Nuxt's type support. If you are experiencing performance issues, the knowledge sources do not provide a Nuxt-supported workaround for excluding .nuxt—it is required for correct type checking and IDE support.
If you continue to have issues, you may want to look for large or problematic files elsewhere in your project, or try restarting your IDE and TypeScript server as a troubleshooting step.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@gaunt rapids Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@glass falcon Ok, so how do I discover wich file inside .nuxt is causing this issue?
Let me check the knowledge base for you again. One moment! :books:
I'm sorry, but the knowledge sources do not provide a method or tool for discovering which specific file inside the .nuxt directory might be causing TypeScript or IntelliSense issues. The documentation and related discussions only mention that .nuxt is auto-generated and essential for type support, and do not cover debugging or inspecting individual files within .nuxt for performance or type-checking problems Nuxt Directory Structure: .nuxt.
If you need to explore the generated files, the documentation suggests using the Nuxt DevTools in development mode and navigating to the Virtual Files tab, but it does not specify how to identify problematic files for TypeScript or IntelliSense issues.
If you need more targeted troubleshooting, you may need to look for guidance outside the provided knowledge sources.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@gaunt rapids Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Let me check the knowledge base for you again. One moment! :books:
Reason: Mass mention
The knowledge sources do not provide an explicit explanation for why "../../../.." appears in the include array of .nuxt/tsconfig.json, nor do they document the impact of this entry or how to safely remove or modify it.
However, there is some relevant context: Nuxt auto-generates .nuxt/tsconfig.json with includes and paths that are intended to provide full type support and auto-imports for your project. Overwriting or modifying these settings directly is not recommended, as it may break type resolution or Nuxt features. The documentation suggests that if you need to customize TypeScript behavior, you should do so via the alias property in your nuxt.config, not by editing the generated .nuxt/tsconfig.json or its include array Nuxt Directory Structure: tsconfig.json Auto-generated Types.
If the "../../../.." entry is causing performance or IntelliSense issues, the knowledge sources do not provide a supported way to remove or alter it. This entry is likely included to ensure all relevant files are available for type checking, but if it is too broad for your use case, there is no documented Nuxt configuration to change this behavior.
In summary:
The knowledge sources do not explain why "../../../.." is included or how to safely remove it. Modifying the generated .nuxt/tsconfig.json directly is not supported, and any changes may be overwritten by Nuxt. If this is causing significant issues, you may want to open an issue on the Nuxt GitHub repository to discuss your findings with the Nuxt team, as this is not covered in the official documentation.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@gaunt rapids Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@glass falcon I found the problem. I was using this on my nuxt config:
alias: {
'@': resolve(__dirname, '/')
},
Let me check the knowledge base for you again. One moment! :books:
Defining the @ alias as resolve(__dirname, '/') in your Nuxt config is problematic. According to the official Nuxt documentation, the default @ and ~ aliases both point to your <srcDir>, which is typically the root of your source directory. Overriding @ to point to the filesystem root (/) can cause Nuxt and TypeScript to include and scan your entire filesystem, leading to severe performance issues and unexpected behavior—such as the overly broad "../../../.." include in your generated .nuxt/tsconfig.json Nuxt Config: alias.
The recommended approach is to not override the @ alias unless you have a specific need, and if you do, ensure it points to your source directory, not the root of your filesystem. For example:
import { resolve } from 'pathe'
export default defineNuxtConfig({
alias: {
'@': resolve(__dirname, './') // points to your project root (srcDir)
}
})
Or, simply omit the @ alias override to use Nuxt's sensible default.