You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought that dist/foo.d.ts should be a correct output but dist/bar.d.ts not. I expect both them should bundle all the types from kit and without any import statements.
When I try to build again after removing typesVersions from kit/package.json, there are something getting error:
error Failed to emit declaration files. (cjs0)
error /Users/bytedance/repositories/repro-rslib-bundle-typings/src/bar.ts:1:34 - error TS2307: Cannot find module 'kit/node' or its corresponding type declarations.
There are types at '/Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/kit/dist/node.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
error DTS generation failed
at emitDts (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/tsc.js:104:23)
at async generateDts (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/dts.js:116:5)
at async process.<anonymous> (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/dts.js:130:9)
error Failed to emit declaration files. (cjs1)
error /Users/bytedance/repositories/repro-rslib-bundle-typings/src/bar.ts:1:34 - error TS2307: Cannot find module 'kit/node' or its corresponding type declarations.
There are types at '/Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/kit/dist/node.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
error DTS generation failed
at emitDts (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/tsc.js:104:23)
at async generateDts (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/dts.js:116:5)
at async process.<anonymous> (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/dts.js:130:9)
error Failed to build.
error Error occurred in cjs0 DTS generation
at handler (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/rsbuild-plugin-dts/dist/index.js:61:57)
at Object.call (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/@[email protected]/node_modules/@rsbuild/core/dist/index.js:5445:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async onDone (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/@[email protected]/node_modules/@rsbuild/core/dist/index.js:5613:9)
at async Object.fn (file:///Users/bytedance/repositories/repro-rslib-bundle-typings/node_modules/.pnpm/@[email protected]/node_modules/@rsbuild/core/dist/index.js:5559:15)
Version
Details
There are two entries for comparing the differences of bunding types between root and sub-directory.
src/foo.ts
src/bar.ts
Actually, both of
kit
andkit/node
exports same stuff.After running
rslib build
we will get:dist/foo.d.ts
dist/bar.d.ts
I thought that
dist/foo.d.ts
should be a correct output butdist/bar.d.ts
not. I expect both them should bundle all the types fromkit
and without any import statements.When I try to build again after removing
typesVersions
fromkit/package.json
, there are something getting error:So I modify
tsconfig.json
according to the logs.It works for me. Not sure about is it an expected behaviour?
Reproduce link
https://github.com/Asuka109/repro-rslib-bundle-typings
Reproduce Steps
pnpm install
pnpm build
The text was updated successfully, but these errors were encountered: