Comments (6)
Also hitting this as well. In dev mode I have a malformed .tsx file and it causes the whole process to die. I was hoping to just catch the error and print the error and have it retry next run.
Perhaps nodemon might help here..
from tsx.
Maybe related? evanw/esbuild#577
from tsx.
Additional info: This issue does indeed kill the process, by the way. For example, if you add a setInterval
to the top of load.mjs
:
import module from 'node:module';
// Timer to keep the process allive
setInterval(() => console.log(Date.now()), 1000);
console.log('STARTING ...\n');
...
... you'll see the process exits under tsx
before the timer even has a chance to fire. Whereas in node
it will happily chug right along logging once/second.
from tsx.
Yep, node.js dynamic import or require can be caught, but tsx cannot.
try {
const x = await import(`./file-with-syntax-error.js`);
console.log(x);
} catch (e) {
console.log(`caught error in try/catch block`);
console.error(e);
}
Change the .js file with a .ts and you'll see the issue.
Right now my whole dev experience breaks with a syntax error and I have to a non-ignored file and save it to restart the process.
from tsx.
Fixed in https://github.com/pvtnbr/tsx/pull/7
from tsx.
Released in https://github.com/privatenumber/tsx/releases/tag/v4.8.1
from tsx.
Related Issues (20)
- Typescript REPL HOT 1
- Multiline input in Typescript REPL
- Feature request: Extend 'tsx watch' for run command on detects file changes HOT 2
- Parse error when using classes and complicated hashbangs
- Script not running when node=21, type="module", watchmode is enabled, is importing from "node:process" and using turborepo HOT 1
- Support `--input-type=ts` HOT 2
- tsx can't run code with endent HOT 3
- Is Bundle / Compile command planned? HOT 1
- Regression with MikroORM introduced with tsx v4.9.1 HOT 2
- Regression in 4.9.1 βΒ Cannot find module (β¦) Did you mean to import "β¦.js"? HOT 2
- Modules imported dynamically from an absolute path are not loaded/handled by tsx v4.9.1 HOT 3
- π Logo early preview and feedback
- `node:assert`'s `assert.ok(false)` is really slow when using tsx HOT 5
- Unexpected `top-level await error` for `type: module` + top level await in `node_modules` HOT 1
- [ESM / Node v22] Broken import of a correctly bundled library HOT 3
- Incompatible with `import-in-the-middle` loader HOT 4
- Parsing error when using variable `of` HOT 7
- Cannot be used with Nuxt HOT 5
- c8 incorrectly reports 100% coverage when using tsx HOT 2
- tsx fails to find aliased imports from workspace dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsx.