Skip to content

ts type alias fails with Parcel but works with tscΒ #64

Description

@mverleg

(I originally reported this at Parcel, but it seems it might be related to this plugin, so I'm moving it here)

πŸ› bug report

Compiling the MWE (involving type) fails with Parcel

πŸ–ŒοΈ HTML

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"></head>
<body>
<script src="core.ts"></script>
</body>
</html>

β˜• TS

type Cb = () => void;
let q: Cb = () => { console.log('hello') };

πŸŽ› Configuration (.babelrc, package.json, cli command)

"parcel-bundler": "^1.11.0",
"parcel-plugin-typescript": "^1.0.0",
"sass": "^1.15.3",
"typescript": "^3.2.2",
"minimatch": "3.0.4"

πŸ€” Expected Behavior

The example compiles fine, the way it does when using tsc core.ts

😯 Current Behavior

$ parcel index.html
🚨  /home/mark/benjamin-jsclient/MWE/core.ts:2:9: Unexpected token, expected ";" (2:9)
  1 | 
> 2 |     type Cb = () => void;
    |         ^
  3 |     let q: Cb = () => { console.log('hello') };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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