Repository navigation
Let code that calls init() run on Node.js, so that the types match the build loaded at run time - #179
Merged
Merged
Conversation
…e build loaded at run time - Give the Node.js build a default init and an initSync that do nothing, as the web build has - Add an ES module entry for Node.js, so that import gets init as the default export - Check init and initSync through import and require in the smoke and type tests - State in the README and docs/wasm that the types need TypeScript 5.2 or later Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CoverageFor 36e6e8e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
import init, { Database } from "jetdb-wasm"; await init();type-checked but failed on Node.js withTypeError: init is not a function.initand aninitSyncthat do nothing, since it is ready when loaded; an ES module entry,node/jetdb_wasm.mjs, givesinitas the default export toimport, re-exporting the CommonJS build. Their types do not use the types of the browser.initandinitSyncthrough both import and require. The README and docs/wasm (English and Japanese) state that the types need TypeScript 5.2 or later.🤖 Generated with Claude Code