Use Deno-native grammy to avoid node-fetch crash - #15
Merged
Conversation
jihchi
force-pushed
the
fix/use-deno-native-grammy
branch
3 times, most recently
from
March 2, 2026 18:33
2e56da6 to
10d7e4b
Compare
Switch grammy import from npm:grammy@^1 to deno.land/x/grammy@v1.41.0. The npm version bundles node-fetch@2.7.0, which crashes on Deno with 'Cannot read properties of null (reading cancelHandleRid)' when the Node.js compat layer tries to abort an HTTP request. The Deno-native distribution uses the built-in fetch API instead. Also adds --allow-import to the cli task, required by grammy's Deno distribution for its cdn.skypack.dev dependency.
jihchi
force-pushed
the
fix/use-deno-native-grammy
branch
from
March 2, 2026 18:35
10d7e4b to
92d7b3d
Compare
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.
Problem
The app crashes with:
This is caused by
node-fetch@2.7.0(a transitive dependency of the npm version of grammy) running through Deno's Node.js compatibility layer. When a network error triggers request abort, the compat layer's internal socket handle is already null.Fix
npm:grammy@^1todeno.land/x/grammy@v1.41.0, which uses Deno's built-infetchAPI instead ofnode-fetch--allow-importto the cli task (required by grammy's Deno distribution for itscdn.skypack.devdependency)All tests pass.