-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(mini-runner): 修复 @babel/parser 与 acron 关于动态 import()
解析类型不一致导致的报错
#11589
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
@luckyadam ,CC |
不用 |
@Chen-jj |
Chen-jj
added
V-3
Version - 3.x
and removed
question
Further information is requested
labels
Apr 19, 2022
ping @Chen-jj |
感谢贡献~ |
Chen-jj
approved these changes
Apr 25, 2022
@wuchangming 请问你这个问题解决了吗?是要升级babel-preset-taro依赖吗? |
@Youngwellcool ,解决方案就是这个 PR 的改动。不需要升级 |
您好,你的邮件我已经收到了。谢谢!
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个 PR 做了什么? (简要描述所做更改)
当 babel-preset-taro 设置 "dynamic-import-node": false 时,使用动态 import 时,会出现报错
Module parse failed: baseVisitor[type] is not a function
修复方式:在 baseVisitor 中忽略掉
Import
类型。原因是
@babel/parser
与acorn
关于 Import() 的类型解析不一致导致@babel/parser -- > type: Import
acorn --> type: ImportExpression
webpack 中使用的是 @babel/parser
,所以导致和此处的 acorn-walk 不兼容https://astexplorer.net/ 中可验证 AST 中的差异:
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: