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

Packup serve crashes on syntax error in the source code and then does not pick up subsequent updates to the source code #60

Open
berkes opened this issue Mar 26, 2024 · 0 comments

Comments

@berkes
Copy link

berkes commented Mar 26, 2024

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
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

1 participant