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

Error: You gave us a visitor for the node type StaticBlock but it's not a valid type #9067

Closed
everything8 opened this issue Apr 9, 2021 · 3 comments
Assignees
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@everything8
Copy link

everything8 commented Apr 9, 2021

相关平台

微信小程序

复现仓库

https://github.com/everything8/myRapp.git
小程序基础库: react native
使用框架: React

复现步骤

1.运行 npx @tarojs/cli init myApp 创建项目
2.运行 yarn dev:rn 执行报错

期望结果

期望正常执行

实际结果

执行报错:
PS E:\projects\taro-proj\myRapp> yarn dev:rn
yarn run v1.22.10
$ npm run build:rn -- --watch

[email protected] build:rn E:\projects\taro-proj\myRapp
taro build --type rn "--watch"

� Taro v3.2.1

Error: You gave us a visitor for the node type StaticBlock but it's not a valid type
at verify (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:112:13)
at explode (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:34:3)
at Object.merge (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:147:5)
at Object. (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\plugin-transform-object-super\node_modules@babel\helper-replace-supers\lib\index.js:60:44)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Module._compile (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Object.newLoader [as .js] (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
(node:5252) UnhandledPromiseRejectionWarning: Error: You gave us a visitor for the node type StaticBlock but it's not a valid type
at verify (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:112:13)
at explode (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:34:3)
at Object.merge (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\traverse\lib\visitors.js:147:5)
at Object. (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules@babel\plugin-transform-object-super\node_modules@babel\helper-replace-supers\lib\index.js:60:44)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Module._compile (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Object.newLoader [as .js] (C:\Users\demo\AppData\Local\Yarn\Data\global\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
(node:5252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:5252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 3.48s.

环境信息

� Taro v3.2.1


  Taro CLI 3.2.1 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.18.4 - D:\nodejs\nvm\nodejs\node.EXE
      Yarn: 1.22.10 - D:\nodejs\nvm\nodejs\yarn.CMD
      npm: 6.14.6 - D:\nodejs\nvm\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Apr 9, 2021
@luckyadam luckyadam added T-rn Target - 编译到 React Native and removed T-weapp Target - 编译到微信小程序 labels Apr 12, 2021
@zhiqingchen
Copy link
Member

https://github.com/everything8/myRapp.git
试了下可以正常运行。

尝试下手动加入以下依赖,安装后重新运行

"@tarojs/taro-rn": "3.2.1"
"@tarojs/rn-runner": "3.2.1"
"react-native": "^0.64.0"

@zhiqingchen
Copy link
Member

如再有问题,请reopen

@jschyz
Copy link

jschyz commented Apr 7, 2022

移除一些 yarn global 其他命令;如 @vitejs/ @umijs/ 等等,就好了。估计 @babel 冲突了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

4 participants