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

Closed
mverleg opened this issue Jan 23, 2019 · 3 comments
Closed

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

mverleg opened this issue Jan 23, 2019 · 3 comments

Comments

@mverleg
Copy link

mverleg commented Jan 23, 2019

πŸ› 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') };
@mverleg mverleg changed the title type alias fails with Parcel but works with tsc ts type alias fails with Parcel but works with tsc Jan 23, 2019
@mischnic
Copy link
Member

Is this a message from parcel-plugin-typescript or parcel itself?

@mverleg
Copy link
Author

mverleg commented Jan 23, 2019

Good question. I didn't know how to tell, so I removed node_modules and reinstalled without plugin. Seems it works now! So I guess this issue is invalid here, sorry.

@mverleg mverleg closed this as completed Jan 23, 2019
@mischnic
Copy link
Member

reinstalled without plugin.

Just a heads up: this will ignore any type information. If it works without the plugin, please file a issue over there.

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