Skip to content

compilation with type annotated variable fails  #69

@muelli

Description

@muelli

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.
$ 

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