Skip to content

Conversation

@ryanramage
Copy link
Contributor

Running the example.js file twice would throw the following error

/Users/ryan/github/holepunch/hyperdispatch/builder.cjs:27 throw new Error('Cannot change the hyperdispatch offset once it has been defined once') ^
This was because the offset in the json was 0, but the opts when using the Hyperdispatch.from would be undefined in normal world usage.

This fix

  • makes sure that offset is defined before doing the offest comparison
  • runs example.js twice in normal usage as part of the npm test to ensure normal rebuilding works
  • excludes the spec folder from git

@ryanramage ryanramage requested a review from andrewosh August 24, 2025 16:36
@ryanramage ryanramage changed the title FIX: Hyperdispath.from in normal rebuild does not set offset in opts FIX: Hyperdispatch.from in normal rebuild does not set offset in opts Aug 24, 2025
@ryanramage ryanramage changed the title FIX: Hyperdispatch.from in normal rebuild does not set offset in opts FIX: Hyperdispatch.from in normal usage does not set { offset } in opts Aug 24, 2025
@andrewosh
Copy link
Contributor

Nice LGTM

@andrewosh andrewosh merged commit 9f0a816 into main Aug 26, 2025
3 checks passed
@andrewosh andrewosh deleted the rebuild-fix branch August 26, 2025 13:17
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.

3 participants