Skip to content
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

Add @types/node as devDependency to all typescript templates #18600

Open
4 tasks done
smeng9 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #18642
Open
4 tasks done

Add @types/node as devDependency to all typescript templates #18600

smeng9 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #18642
Labels
enhancement New feature or request feat: create-vite create-vite package

Comments

@smeng9
Copy link
Contributor

smeng9 commented Nov 6, 2024

Description

When following official guides that imports path library or use __dirname in https://vite.dev/guide/build.html#multi-page-app we will encounter typescript errors.

Screenshot 2024-11-06 at 10 09 19 AM

This is not a very good developer experience.

Suggested solution

Add @types/node to devDependencies of vite templates.

Alternative

Add a description section in the document that user needs to import such library or change tsconfig.node.json settings.

Additional context

No response

Validations

@bluwy
Copy link
Member

bluwy commented Nov 8, 2024

Seems fair to me 👍 The tricky thing I guess is that users may want to align the node version to the one they're using locally while calling npm create vite. Maybe that can be separately tackled if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat: create-vite create-vite package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants