parse5 icon indicating copy to clipboard operation
parse5 copied to clipboard

7.2.0 throws a TS error TS1383: Only named exports may use 'export type'

Open xealgo opened this issue 1 year ago • 4 comments

The exact error is:

node_modules/parse5/dist/index.d.ts(5,1): error TS1383: Only named exports may use 'export type'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My temporary solution was to create a package.json resolutions entry for 7.1.2 since this package is a dependency of another package and not a direct dependency. That was after upgrading Node to 21 and TS to 5.4.3.

xealgo avatar Oct 15 '24 18:10 xealgo

this is very strange

export type * should work in 5.x of typescript

locally I can reproduce the error in 4.9.5 but not in any 5.x version. could you double check the version your editor is using (of typescript) is actually >=5?

and if it is, let us know which one exactly so I can try reproduce

43081j avatar Oct 16 '24 05:10 43081j

https://github.com/inikulin/parse5/releases/tag/v7.2.0 mentions upgrading typescript 4 to 5, I guess it's intentional to no longer support typescript 4?

gajones155 avatar Oct 17 '24 18:10 gajones155

mentions upgrading typescript 4 to 5

This is a breaking change, why is this a minor version bump and not v8.0.0? We are using jsdom package that has dependency "parse5": "^7.1.2" which broke our build because it installs version 7.2.0.

lOlbas avatar Oct 18 '24 08:10 lOlbas

The version bump was correct. It wasn't intentional

We can just update the export to work with 4.x I think

43081j avatar Oct 19 '24 00:10 43081j

For yarn users, setting the following in your package.json should get you by until a patch is released.

"resolutions": { "parse5": "7.1.2" }

wickkidd avatar Oct 21 '24 22:10 wickkidd