rspack
rspack copied to clipboard
[Bug]: Type error from @rspack/core/dist/config/zod.d.ts
System Info
System:
OS: macOS 14.5
CPU: (12) arm64 Apple M2 Max
Memory: 626.78 MB / 32.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Binaries:
Node: 20.12.2 - ~/.managed/n/bin/node
Yarn: 3.5.0 - ~/.managed/n/bin/yarn
npm: 10.5.0 - ~/.managed/n/bin/npm
Watchman: 2024.03.18.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 124.0.6367.119
Firefox Developer Edition: 102.0
Safari: 17.5
Details
> @jupyterlab/[email protected] build
> tsc
../node_modules/@rspack/core/dist/config/zod.d.ts:4538:37 - error TS2589: Type instantiation is excessively deep and possibly infinite.
4538 export declare const rspackOptions: z.ZodObject<{
~~~~~~~~~~~~~
4539 name: z.ZodOptional<z.ZodString>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
7245 bail?: boolean | undefined;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7246 }>;
~~
../node_modules/@rspack/core/dist/config/zod.d.ts:4538:49 - error TS2344: Type '{ name: z_ZodOptional<ZodString>; dependencies: z_ZodOptional<z_ZodArray<ZodString, "many">>; entry: z_ZodOptional<z_ZodUnion<[z_ZodUnion<...>, z_ZodFunction<...>]>>; ... 25 more ...; bail: z_ZodOptional<...>; }' does not satisfy the constraint 'ZodRawShape'.
Property 'target' is incompatible with index signature.
Type 'z_ZodOptional<z_ZodUnion<[z_ZodUnion<[z_ZodLiteral<false>, z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodUnion<[z_ZodEnum<["web", "webworker", "es3", "es5", "es2015", "es2016", ... 6 more .....' is not assignable to type 'ZodTypeAny'.
The types returned by 'brand(...)' are incompatible between these types.
Type 'ZodBranded<ZodOptional<z_ZodUnion<any>>, any>' is not assignable to type 'ZodBranded<ZodType<any, any, any>, any>'.
Type 'ZodOptional<z_ZodUnion<any>>' is missing the following properties from type 'ZodType<any, any, any>': _type, _output, _input, _def, and 31 more.
4538 export declare const rspackOptions: z.ZodObject<{
~
4539 name: z.ZodOptional<z.ZodString>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
6413 bail: z.ZodOptional<z.ZodBoolean>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6414 }, "strict", z.ZodTypeAny, {
~
Found 2 errors in the same file, starting at: ../node_modules/@rspack/core/dist/config/zod.d.ts:4538
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @jupyterlab/[email protected]
npm ERR! at location: /Users/kfll/Developer/jupyterlab/builder
Reproduce link
No response
Reproduce Steps
importing @rspack/core
in a ts project without skipLibCheck
enabled.