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

Hello, I'm encountering an error when logging in after integrating the SDK: "Error invoking initSDK: TypeError: Invalid value used as weak map key." #58

Open
bobo999-craate opened this issue Jul 15, 2024 · 1 comment

Comments

@bobo999-craate
Copy link

OpenIM Server Version

是直接运行的命令npm install open-im-sdk-wasm @openim/electron-client-sdk --save

Operating System and CPU Architecture

Windows (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

Error invoking initSDK: TypeError: Invalid value used as weak map key

Screenshots Link

你好,这个是git地址https://gitee.com/z-qiaoer/openim-apply.git,运行的话用命令npm run electron:dev;感谢大哥们帮忙解决一下

@Bloomingg
Copy link
Member

To integrate the @openim/electron-client-sdk into the Electron main process, follow these steps:

  1. Import the SDK
    Import the SDK in the main process using the require statement:

    const OpenIMSDKMain = require("@openim/electron-client-sdk");
  2. Load the Renderer Script
    Make sure to import your renderer script (render.js) in the main process. This ensures that the renderer script is correctly initialized and ready to communicate with the main process.

  3. API Calls
    Call the API within appropriate lifecycle events or response to specific events. Ensure that the platformID parameter is a numeric value, which is necessary for the API to function correctly.

By following these guidelines, you can ensure a seamless integration of the SDK in your Electron application's main process.

@skiffer-git skiffer-git changed the title 你好,引入sdk 登录的时候报错Error invoking initSDK: TypeError: Invalid value used as weak map key Hello, I'm encountering an error when logging in after integrating the SDK: "Error invoking initSDK: TypeError: Invalid value used as weak map key." Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants