-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix(nuxt): add exclude
paths to nitro tsconfig.server.json
#22768
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
Conversation
Fixed Cannot write file '/Users/{USERNAME}/nuxt-app/dist/_nuxt/A.vue.62ba23ef.js' because it would overwrite input file.
|
packages/nuxt/src/core/nitro.ts
Outdated
include: [ | ||
join(nuxt.options.buildDir, 'types/nitro-nuxt.d.ts') | ||
] | ||
typescript: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may accidentally have introduced an extra layer of nesting.
packages/nuxt/src/core/nitro.ts
Outdated
tsconfigPath: "tsconfig.server.json", | ||
tsConfig: { | ||
include: [join(nuxt.options.buildDir, "types/nitro-nuxt.d.ts")], | ||
exclude: ["../dist", "../.output"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also will need to exclude node_modules if explicitly mentioning exclude paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unfamiliar with the repo. I just saw this bug while developing a nuxt app. You probably can make those exclude paths better :)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
exclude
paths to nitro tsconfig.server.json
@@ -115,6 +115,11 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) { | |||
tsConfig: { | |||
include: [ | |||
join(nuxt.options.buildDir, 'types/nitro-nuxt.d.ts') | |||
], | |||
exclude: [ | |||
...nuxt.options.modulesDir.map(m => relativeWithDot(nuxt.options.buildDir, m)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Consider modulesDir
can technically be normal directories with parent/sibling node_modules
dir) as well. We might have filtered out the ones not ending with node_modules
here for greater safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice idea. I've just copied across our current default in the nuxt tsconfig so if we filter it further we should update them in parallel.
Fixed
Cannot write file '/Users/{USERNAME}/nuxt-app/dist/_nuxt/A.vue.62ba23ef.js' because it would overwrite input file.
π Linked issue
β Type of change
π Description
π Checklist