Ant-design-pro: 下载pro然后报错🐛[BUG]

Created on 8 Jun 2020  ·  6Comments  ·  Source: ant-design/ant-design-pro

🐛 bug 描述

下载没问题,但是在改js过程中报错

[Sylvanas] Prepare js environment...
events.js:187
throw er; // Unhandled 'error' event
^

SyntaxError: unknown: Unexpected token (24:12)

22 | };
23 |

24 | export type { DefaultSettings };
| ^
25 |
26 | export default proSettings;
27 |
at Object.raise (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:6387:17)
at Object.unexpected (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:7704:16)
at Object.parseIdentifierName (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:9592:18)
at Object.parseIdentifier (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:9570:23)
at Object.tsParseTypeAliasDeclaration (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:4793:20)
at Object.tsParseDeclaration (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:5111:23)
at Object.tsTryParseExportDeclaration (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:5020:17)
at Object.parseExportDeclaration (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:5497:26)
at Object.maybeParseExportDeclaration (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:11038:31)
at Object.parseExport (/Users/hengxinsky/.config/yarn/global/node_modules/@babel/parser/lib/index.js:10967:29)
Emitted 'error' event on AntDesignProGenerator instance at:
at Immediate. (/Users/hengxinsky/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:436:22)
at processImmediate (internal/timers.js:439:21) {
pos: 441,
loc: Position { line: 24, column: 12 },
code: 'BABEL_PARSE_ERROR'
}

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

🛑 bug

Most helpful comment

yarn global remove create-umi yarn global remove prisma 成功修复

All 6 comments

这个看了似乎是sylvanas转ts为js出现异常导致的,不知道什么时候能修复啊

yarn global remove create-umi yarn global remove prisma 成功修复

yarn global remove create-umi yarn global remove prisma 成功修复

为什么这样可以?这是不是相当于重装umi?

因为你的 ts 版本太低了,pro 中用了 3.8 版本中支持的 export type

因为你的ts版本太低了,pro中用了3.8版本中支持的 export type

我的用的[email protected],并且我尝试把版本到[email protected]还是不行

因为你的 ts 版本太低了,pro 中用了 3.8 版本中支持的 export type

我发现了,好像不是我的ts版本问题,我使用antd@3就可以但是antd@4不行,就是在ts转js的时候

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhuanglong picture zhuanglong  ·  3Comments

2uncle-code picture 2uncle-code  ·  3Comments

yjz1004 picture yjz1004  ·  3Comments

RichardStark picture RichardStark  ·  3Comments

ghost picture ghost  ·  3Comments