TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.83k stars 576 forks source link

Cannot find module `.output/server/index.mjs` #2378

Closed dillondotzip closed 3 days ago

dillondotzip commented 3 days ago

Which project does this relate to?

Start

Describe the bug

When running bun run start (vinxi start) I get the following error: Cannot find module '/..../.output/server/index.mjs' imported from /...../node_modules/vinxi/bin/cli.mjs

I have no problems building the project.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/react/examples/start-basic

Steps to Reproduce the Bug or Issue

Use any example from tanstack start repo.

Run vinxi build then vinxi start.

Expected behavior

It should successfully run the server.

Screenshots or Videos

No response

Platform

- "@tanstack/start": "^1.58.4",
- "@tanstack/react-router": "^1.58.3",
- "@tanstack/router-plugin": "^1.58.4",
-  "vinxi": "^0.4.3"

Runtime: Bun

Additional context

Some more context https://github.com/nksaraf/vinxi/issues/177

dillondotzip commented 3 days ago

I solved this by explicitly setting the preset to node-server. It seems to be using vercel preset by default (even though in the vinxi docs it says it uses node-server by default).

  "scripts": {
    "dev": "vinxi dev",
    "build": "vinxi build --preset node-server",
    "start": "vinxi start --preset node-server",
  }