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

mobx 页面index.jsx @inject('store') X [ERROR] Unexpected "@" #12336

Closed
lceihen opened this issue Aug 20, 2022 · 9 comments
Closed

mobx 页面index.jsx @inject('store') X [ERROR] Unexpected "@" #12336

lceihen opened this issue Aug 20, 2022 · 9 comments
Labels
F-react Framework - React question Further information is requested T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@lceihen
Copy link

lceihen commented Aug 20, 2022

相关平台

微信小程序

小程序基础库: vscode build报错
使用框架: React

复现步骤

直接安装 taro 3.5

期望结果

无报错

实际结果

报错

环境信息

👽 Taro v3.5.0


  Taro CLI 3.5.0 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.15.0 - D:\lceihen\install\node\node\node.EXE
      Yarn: 1.22.10 - D:\lceihen\install\node\node\node_global\yarn.CMD
      npm: 8.1.4 - D:\lceihen\install\node\node\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 20, 2022
@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 22, 2022

@lceihen 没有复现,请升级到最新版再试试,或提供完整可复现 demo

@Chen-jj Chen-jj added the question Further information is requested label Aug 23, 2022
@ywanhzy
Copy link

ywanhzy commented Aug 25, 2022

taro3.5.4 版本 我这边也是一样的错误

@inject("store")
@observer

[ERROR] Unexpected "@"

src/components/banner/index_home.js:15:0:
  15 │ @inject("store")

✘ [ERROR] Expected identifier but found "@"

src/store/enter-option.js:10:2:
  10 │   @observable

@QingyunYang
Copy link

装饰器报错,哪位有解决方案了吗?

@lisonge
Copy link

lisonge commented Sep 22, 2022

把 jsx 改成 tsx ,或者 把装饰器改成原始函数调用 ,这对我有效

@charsea
Copy link

charsea commented Nov 10, 2022

同问,有 jsx 解决方案了吗

@lceihen
Copy link
Author

lceihen commented Nov 10, 2022

看起来此issue大概率不会被修复,因为不影响到主流程的,我是这样解决的:在选择模板时不使用自带的mobx,选择cli安装完成后手动引入mobx6,目前没发现由于引入导致的bug

@yoyo837
Copy link
Contributor

yoyo837 commented Nov 10, 2022

别急啊, 挂几个月的issue老多了;

只要是问题, 应该支持的都可以尽量支持,member有时间会处理的, 也欢迎有意愿参与共建的提交PR;

@ChiJohn
Copy link

ChiJohn commented Dec 5, 2022

同问,有解决方案了吗?

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 21, 2022

Duplicate of #13007

@yoyo837 yoyo837 marked this as a duplicate of #13007 Dec 21, 2022
@yoyo837 yoyo837 closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React question Further information is requested T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

8 participants