-
Notifications
You must be signed in to change notification settings - Fork 52
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
[BUG] MainContentLayout-868bfdc8.js:1 TypeError: window.commonEventFunc is not a function at We.login (open-im-sdk-wasm-3b339908.js:1:25495) #128
Comments
Did you move the openIM.wasm file? |
No ,I am using an Electron demo and using Electron Forge to package the project without changing any code. |
So you are not using the official demo, maybe you can refer to the official electon demo. Your problem is because the openIM.wasm file is not loaded correctly. |
You need to make sure that the packaged file can still be loaded correctly into the wasm file. In fact, the dev and prod environments are somewhat different. For example, the following processing is done in |
I modified the path as you suggested, but still reported the same error, |
actually, I don’t mean to ask you to change the path to the same path as mine… Because the basic framework structure of your project may not be the same as the demo, the key point is how to find the correct import path that belongs to your project structure. |
我这边是网页版报了类似的错误,原因是nginx的mine.types缺少wasm的类型,没有正确识别解析wasm文件导致的。 |
I reported a similar error on the web version. The reason is that nginx's mine.types lacks the wasm type and does not correctly identify and parse the wasm file. |
I modified the package directory of openIM.wasm. I can get the correct address directly under the Resources file, but window.commonEventFunc is not a function still exists. I found that Electron may have file path problems, especially in production environments, where file:// protocol paths cannot be loaded directly using the browser environment. Is this error related to this? |
you can update you sdk and try again. npm i @openim/wasm-client-sdk@latest |
I used the latest version of openIMSDK ("@openim/wasm-client-sdk": "^3.8.1",) and the Electron Demo from github, and packaged it into an app file with Electron Forge, but still got an error. |
我使用的是Electron Demo。我没有理解这个配置该如何修改 |
the latest version is |
OpenIM Server Version
3.8.0
Operating System and CPU Architecture
macOS (ARM)
Deployment Method
Source Code Deployment
Bug Description and Steps to Reproduce
I’m using an Electron demo that references open-im-sdk-web-wasm 3.8.0. When running the project with npm run dev, no errors occur. However, after packaging the project into a .app file, I get the following error: TypeError: window.commonEventFunc is not a function at We.login (open-im-sdk-wasm-3b339908.js:1:25495), and I’m unable to log in to IMSDK.”
Screenshots Link
No response
The text was updated successfully, but these errors were encountered: