-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Description
Bug report
Describe the bug
When components with flow types are used the pages using those components throw an "Unexpected token" error due to type.
Packages:
- babel/preset-flow
- flow-bin
.babelrc
- babel/preset-flow in in
presets - babel/plugin-transform-flow-strip-types in
plugins.
To Reproduce
git clone git@github.com:bryanterrell/hello-next-flow.gitcd hello-next-flownpm inpm run dev- Open http://localhost:3000 in browser & click Go to About Page
- Error is produced:
Syntax Error: Unexpected token, expected ";" (3:5)
1 | import * as React from "react";
2 |
> 3 | type Props = {
| ^
4 | foo: number,
5 | bar?: string
6 | };
Expected behavior
Flow types should be stripped out so component / page can be rendered.
System information
- OS: macOS
- Next.js version: 6.0.3
jyotiarora2610, ayushikhetan, mduthilleul, elzup, evenchange4 and 13 moreazizhk
Metadata
Metadata
Assignees
Labels
No labels