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

node_modules/parse5/dist/index.d.ts:1:15 - error TS1005: ',' expected. #878

Closed
ilrein opened this issue Apr 3, 2023 · 4 comments
Closed

Comments

@ilrein
Copy link

ilrein commented Apr 3, 2023

I'm currently using vite (which uses parse5 internally) and vercel. While building serverless functions in vercel, I notice I am always getting typescript errors from parse5.

It doesn't actually impact the development and nothing fails, but it does fill my console with issues.

IE:

node_modules/parse5/dist/index.d.ts:1:15 - error TS1005: ',' expected.

1 import { type ParserOptions } from './parser/index.js';
                ~~~~~~~~~~~~~

node_modules/parse5/dist/index.d.ts:4:15 - error TS1005: ',' expected.

4 export { type DefaultTreeAdapterMap, defaultTreeAdapter } from './tree-adapters/default.js';
                ~~~~~~~~~~~~~~~~~~~~~

node_modules/parse5/dist/index.d.ts:6:15 - error TS1005: ',' expected.

6 export { type ParserOptions, /** @internal */ Parser } from './parser/index.js';
                ~~~~~~~~~~~~~

Currently finds 27 errors. I would love to find a way to silence or remove/fix these, but have no idea how to approach it 🤔

@43081j
Copy link
Collaborator

43081j commented Apr 3, 2023

it'll be a mismatch of typescript versions. importing individual type-only symbols is fairly new, so i suspect your project uses a slightly older typescript (or vite does?)

somewhere down the line there's definitely an older typescript, upgrading it would solve this

@ilrein
Copy link
Author

ilrein commented Apr 3, 2023

I can see that vite uses typescript 5.0.2 while parse5 uses 5.0.3

Think that could the problem?

@43081j
Copy link
Collaborator

43081j commented Apr 3, 2023

apparently its a feature since 4.5 so that seems odd

if you npm ls typescript in that repo, do you see any older ones?

edit: ah only when you deploy to vercel maybe? so possibly vercel runs <4.5?

@ilrein
Copy link
Author

ilrein commented Apr 3, 2023

I would imagine that vercel is agnostic, they deploy everything front-end.

I'm running vercel dev which calls vite --port $PORT

I can see this PR from 2022 that was merged vitejs/vite#9678

The team added parse5 version 7. But then I look at the package json in the newest vite version and there's no reference to parse5 🤔

EDIT: nvm, it's in a folder called packages/vite

They used parse5@7.1.2

I guess it must be the vercel cli

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

No branches or pull requests

2 participants