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

[Unity] Bug: C#异步操作中调用JS时,无法捕获JS异常,但是会打断运行 #1974

Open
3 tasks done
wardehuang opened this issue Jan 25, 2025 · 0 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working Unity

Comments

@wardehuang
Copy link

前置阅读 | Pre-reading

Puer的版本 | Puer Version

2.1.1、2.1.2

Unity的版本 | Unity Version

2022.3.55f1

发生在哪个平台 | Platform

Editor(win)

错误信息 | Error Message

C#异步操作中调用JS时,无法捕获JS异常,但是会打断运行

问题重现 | Bug reproduce

  1. 下载官方的demo
  2. 替换zip包中04_JsBehaviour的文件。JsBehaviour.cs、Resources\rotate.mjs
  3. 打开代码查看JsBehaviour.cs

Image

  1. 打开代码查看rotate.mjs

Image

  1. 直接不作改动运行,控制台能捕获报错

Image

  1. 改动JsBehaviour.cs如下,然后运行。控制台无法捕获报错:

Image

04_JsBehaviour.zip

@wardehuang wardehuang added bug Something isn't working Unity labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unity
Projects
None yet
Development

No branches or pull requests

2 participants