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

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

Open
mverleg opened this issue Jan 26, 2019 · 1 comment
Open

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

mverleg opened this issue Jan 26, 2019 · 1 comment

Comments

@mverleg
Copy link

mverleg commented Jan 26, 2019

(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') };
flaviut added a commit to flaviut/parcel-plugin-typescript that referenced this issue May 1, 2019
@uglycoyote
Copy link

I confirm as of April 2020 I'm getting the same issue on a type alias, where it reports Unexpected token, expected ";". Sad that there hasn't been any improvement in this area. Seems like there are a lot of other issues which are different but similar complaints which are not getting any attention.

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

2 participants