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

compilation with type annotated variable fails #69

Open
muelli opened this issue Oct 25, 2019 · 0 comments
Open

compilation with type annotated variable fails #69

muelli opened this issue Oct 25, 2019 · 0 comments

Comments

@muelli
Copy link

muelli commented Oct 25, 2019

Head over to this repository and see it fail:

https://github.com/muelli/parcel-test/blob/941e445f797329c895bf45ab938519019abc2654/index.ts#L20

after cloning and checking revision 941e445f797329c895bf45ab938519019abc2654 out, yarn install; yarn run parcel build index.html yields an error:

>yarn run parcel build index.html --no-cache
yarn run v1.7.0
$ /tmp/parceltest2/node_modules/.bin/parcel build index.html --no-cache
🚨  /tmp/parceltest2/index.ts: SyntaxError: /tmp/parceltest2/index.ts: Unexpected token (25:20)

  23 | const app = Elm.Main.init({nodee: div});
  24 | 
> 25 | const should_compile: string = "asdf";
     |                     ^
  26 | const should_complain: number = "asdf";
  27 | console.log("yo", should_complain, should_break);
  28 | 
    at Parser.raise (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:6420:17)
    at Parser.unexpected (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:7773:16)
    at Parser.parseVar (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10664:18)
    at Parser.parseVarStatement (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10479:10)
    at Parser.parseStatementContent (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10076:21)
    at Parser.parseStatement (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10009:17)
    at Parser.parseBlockOrModuleBlockBody (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10585:25)
    at Parser.parseBlockBody (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:10572:10)
    at Parser.parseTopLevel (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:9940:10)
    at Parser.parse (/tmp/parceltest2/node_modules/@babel/parser/lib/index.js:11447:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ 
@muelli muelli changed the title compilation with type annoated variable fails compilation with type annotated variable fails Oct 25, 2019
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

1 participant