Skip to content

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

@berkes

Description

@berkes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions