-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Custom Component Retrieval Issue in Build (getComponent returns null) #17898
Comments
I don't think you got it. I mentioned it should be run it remotely, not on your local machine that the point. |
I found one thing - if I set a target in tsconfig = es6 it does not work! |
A slowly network: http://119.3.232.55/web-mobile/index.html |
The root path of import is the dir of script file.So,you should add "../" to return parent dir. |
How can you access remote component? I don't think it is supported. |
Cocos Creator version
3.8.3
System information
chrome, macos, windows
Issue description
I’m experiencing an issue with a custom component attached to a node. When accessing the component locally using the getComponent method, it returns the expected component. However, when accessing the component remotely in a build from remote host, it returns null.
in the attached project - look at PrizeController --> const switcher2 = node.getComponent('NodeSwitchComponent');
Relevant error log output
null
Steps to reproduce
Minimal reproduction project
test.zip
The text was updated successfully, but these errors were encountered: