Packup serve crashes on syntax error in the source code and then does not pick up subsequent updates to the source code
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 337
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
Whenever deno/the build encounters a syntax error, packup serve crashes and needs to be restarted.
Describe the solution you'd like
On exceptions, packup should render the error or exception but keep watching the file tree for changes and then re-try a build on change.
Describe alternatives you've considered
Alternative would be to run packup build in a loop or through an inotify callback, and have another devserver serve the built assets when they change.
Additional context
Just add a syntax error to a .ts file, save it, and the packup process shows the error. E.g.
[ERROR] [plugin deno] The module's source code could not be parsed: Unexpected token `slideControls`. Expected * for generator, private key, identifier or async at file:///xxx/main.ts:116:9
const slideControls = document.getElementById('slideshow-controls') as HTMLElement;
~~~~~~~~~~~~~
Error: Build failed with 1 error:
error: The module's source code could not be parsed: Unexpected token `slideControls`. Expected * for generator, private key, identifier or async at file:///xxx/main.ts:116:9
....
It won't pick up new saves to that file and just hangs. So when fixing this syntax error, the packup process has to be re-started.
$ packup --version
packup v0.2.4
$ deno --version
deno 1.41.0 (release, x86_64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the packup serve watch/build entry point and reproduce the failure by adding a syntax error to main.ts or another .ts file. Verify that the error is rendered without stopping the process, and that a subsequent save retries the build and updates the served output without restarting packup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- deno, typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100