Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vinxi is treeshaking tslib modules needed for bun #402

Open
atoko opened this issue Oct 23, 2024 · 1 comment
Open

Vinxi is treeshaking tslib modules needed for bun #402

atoko opened this issue Oct 23, 2024 · 1 comment

Comments

@atoko
Copy link

atoko commented Oct 23, 2024

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:

ERROR error: Cannot find package "tslib" from "/var/task/app/.output/server/index.mjs"
--
@KATT
Copy link

KATT commented Nov 27, 2024

I got this error too whilst trying to add tslib as a dependency to trpc (trpc/trpc#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"
         },
-        "./*": "./*",
-        "./": "./"
+        "./*": "./*"
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants