Skip to content

No semi-colons at end of compiled lines can throw errors with Terser #1676

Open
@MichaelFedora

Description

@MichaelFedora

Version

15.9.2

Reproduction link

https://github.com/MichaelFedora/vue-loader-fail-terser

Steps to reproduce

Download, npm i, npm start, yay Terser is throwing "Unexpected token: punc (])"

What is expected?

That, even with an excess [], it compiles and runs.

What is actually happening?

Terser throws an error that is hard to debug.


I originally had a Typescript interface with an extra []; trailing at the end because I moved it over from an in-place type definition. This resulted, after the Typescript compiler stripped away the typedefs, in just a sad little array declaration laying in the middle of my code -- and was picked up by terser as trying to access an element of the true value thrown at the end of a compiled .vue file without a semicolon.

You can see more of that being explained in the README.md in the attached repo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions