Unable to build with vite and ts
Tylopilus opened this issue · comments
Helge commented
At the moment it is not possible to build for production using vite and a local installed version of corset via npm. The issue is happening during typecheck with tsc.
Steps to reproduce:
- clone this example: https://stackblitz.com/edit/vitejs-vite-qczl4g?file=src%2Fmain.ts
- run 'npm run build'
current result:
❯ npm run build
$ tsc && vite build
node_modules/corset/lib/binding.d.ts:75:53 - error TS2694: Namespace '"/home/projects/vitejs-vite-qczl4g/node_modules/corset/lib/property"' has no exported member 'PropertyPropName'.
75 export type PropertyPropName = import('./property').PropertyPropName;
~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:26:13 - error TS2456: Type alias 'PropertyDefinition' circularly references itself.
26 export type PropertyDefinition = import('./property').PropertyDefinition;
~~~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:27:13 - error TS2456: Type alias 'SimplePropertyDefinition' circularly references itself.
27 export type SimplePropertyDefinition = import('./property').SimplePropertyDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:28:13 - error TS2456: Type alias 'ShorthandPropertyDefinition' circularly references itself.
28 export type ShorthandPropertyDefinition = import('./property').ShorthandPropertyDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:29:13 - error TS2456: Type alias 'LonghandPropertyDefinition' circularly references itself.
29 export type LonghandPropertyDefinition = import('./property').LonghandPropertyDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:30:13 - error TS2456: Type alias 'KeyedMultiPropertyDefinition' circularly references itself.
30 export type KeyedMultiPropertyDefinition = import('./property').KeyedMultiPropertyDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/corset/lib/property.d.ts:31:13 - error TS2456: Type alias 'BehaviorMultiPropertyDefinition' circularly references itself.
31 export type BehaviorMultiPropertyDefinition = import('./property').BehaviorMultiPropertyDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.ts:9:12 - error TS7006: Parameter 'e' implicitly has an 'any' type.
9 toggle(e) {
~
Found 8 errors in 3 files.
Errors Files
1 node_modules/corset/lib/binding.d.ts:75
6 node_modules/corset/lib/property.d.ts:26
1 src/main.ts:9
~/projects/vitejs-vite-qczl4g
Matthew Phillips commented
Thanks for filing @Tylopilus, I'll prioritize fixing this.
Correct me if I'm wrong here, but it looks like the issue is unrelated to Vite and is just about running tsc? Is that right?
Helge commented
I did not test it without vite but from the output this is just tsc related, yes.
Matthew Phillips commented
I'm able to recreate. Going to make a smoke test to prevent regressions here. Thank you!
Matthew Phillips commented
Fixed in #132, release will go out soon.
Matthew Phillips commented
Fixed in 1.0.2