8000 fix(nuxt): add `exclude` paths to nitro `tsconfig.server.json` by huseeiin Β· Pull Request #22768 Β· nuxt/nuxt Β· GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

huseeiin
Copy link
Contributor

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

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Fixed Cannot write file '/Users/{USERNAME}/nuxt-app/dist/_nuxt/A.vue.62ba23ef.js' because it would overwrite input file.
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

include: [
join(nuxt.options.buildDir, 'types/nitro-nuxt.d.ts')
]
typescript: {
Copy link
Member

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.

tsconfigPath: "tsconfig.server.json",
tsConfig: {
include: [join(nuxt.options.buildDir, "types/nitro-nuxt.d.ts")],
exclude: ["../dist", "../.output"]
Copy link
Member

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

Copy link
Contributor Author

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 :)

@danielroe danielroe changed the title Update nitro.ts (Fix TS5055) fix(nuxt): add exclude paths to nitro tsconfig.server.json Aug 23, 2023
@danielroe danielroe merged commit 427e64d into nuxt:main Aug 23, 2023
@github-actions github-actions bot mentioned this pull request Aug 23, 2023
@@ -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)),
Copy link
Member
@pi0 pi0 Aug 24, 2023

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0