Open atoko opened 1 month ago
I got this error too whilst trying to add tslib as a dependency to trpc (https://github.com/trpc/trpc/pull/6271) (using Node, not Bun).
We have a lot of example projects in tRPC where we do build & e2e tests. TanStack Start is one of them and the only one failing.
Manually patching node_modules/tslib/package.json
with the below makes it pass, that's not really a solution but might give a clue to someone who understands this better than I do
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
},
"import": {
- "node": "./modules/index.js",
- "default": {
- "types": "./modules/index.d.ts",
- "default": "./tslib.es6.mjs"
- }
+ "types": "./modules/index.d.ts",
+ "default": "./tslib.es6.mjs"
},
"default": "./tslib.js"
},
- "./*": "./*",
- "./": "./"
+ "./*": "./*"
}
Looks like vinxi build is not bundling the tslib/modules folder when used with Tanstack Start.
This causes bun to not be able to start the server since it "can't find" tslib. Copying over a non-tree shaked tslib into .output/node_module fixes the issue.
Example error: