privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
9.42k stars 144 forks source link

`tsx >4.11.2` is broken when running `vite` #590

Closed o-alexandrov closed 3 months ago

o-alexandrov commented 3 months ago

Acknowledgements

Minimal reproduction URL

https://github.com/o-alexandrov/bug-tsx-vite

Problem & expected behavior (under 200 words)

To reproduce:

  1. clone example & install deps
  2. run npm run start

see error in cli:

tsx ./node_modules/vite/bin/vite.js

import { defineConfig } from "vite";

export default defineConfig({});

tsx ./node_modules/vite/bin/vite.js

failed to load config from ./vite.config.ts
error when starting dev server:
TypeError: Cannot assign to read only property '.ts' of object '[object Object]'
    at loadConfigFromBundledFile (./node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:66923:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at loadConfigFromFile (./node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:66754:24)
    at resolveConfig (./node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:66364:24)
    at _createServer (./node_modules/vite/dist/node/chunks/dep-h78lQ5BT.js:62977:18)
    at CAC.<anonymous> (./node_modules/vite/dist/node/cli.js:735:20)
privatenumber commented 3 months ago

:tada: This issue has been resolved in v4.15.5

If you rely on this project, please consider making a donation :heart: :pray:

privatenumber commented 3 months ago

Appreciate you always filing great bug reports @o-alexandrov 🙌