Skip to content

fix(internet-identity): hardcode II canister ID, add fetch binding#91

Closed
marc0olo wants to merge 1 commit intomainfrom
fix/ii-skill-canister-id-and-fetch
Closed

fix(internet-identity): hardcode II canister ID, add fetch binding#91
marc0olo wants to merge 1 commit intomainfrom
fix/ii-skill-canister-id-and-fetch

Conversation

@marc0olo
Copy link
Member

Summary

  • Replace wrong fallback canister ID (be2us-64aaa...) with the well-known II canister ID (rdmx6-jaaaa-aaaaa-aaadq-cai) — same on mainnet and local replicas, no dynamic lookup needed
  • Add fetch: window.fetch.bind(window) to HttpAgent.create() to prevent "Illegal invocation" errors in bundled builds (Vite, webpack)
  • Add new pitfall documenting the fetch binding requirement

- Replace wrong fallback (be2us-64aaa...) with well-known II canister ID
  (rdmx6-jaaaa-aaaaa-aaadq-cai) — same on mainnet and local replicas
- Add `fetch: window.fetch.bind(window)` to HttpAgent.create() to prevent
  "Illegal invocation" errors in bundled builds (Vite, webpack)
- Add new pitfall documenting the fetch binding requirement
@marc0olo
Copy link
Member Author

@sea-snake mentioned that Add fetch: window.fetch.bind(window) to HttpAgent.create() to prevent "Illegal invocation" errors in bundled builds (Vite, webpack) should not be required and that this might be an issue in the JS SDK (cc @raymondk @nikosxenakis)

@nikosxenakis
Copy link

nikosxenakis commented Mar 20, 2026

@sea-snake mentioned that Add fetch: window.fetch.bind(window) to HttpAgent.create() to prevent "Illegal invocation" errors in bundled builds (Vite, webpack) should not be required and that this might be an issue in the JS SDK (cc @raymondk @nikosxenakis)

This PR moves the binding of the window inside the agent constructor so consumers don't need to explicitly initialise it dfinity/icp-js-core#1316

@marc0olo
Copy link
Member Author

Superseded by #101 which addresses both changes from this PR:

@marc0olo marc0olo closed this Mar 21, 2026
@marc0olo marc0olo deleted the fix/ii-skill-canister-id-and-fetch branch March 21, 2026 01:02
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

Successfully merging this pull request may close these issues.

2 participants