Bump markdown-it to ^14#15
Open
ottob wants to merge 1 commit into
Open
Conversation
current v13 dep uses Node built-in punycode which Metro/RN can't resolve
@ronradtke/react-native-markdown-display@8.1.0 pins markdown-it: ^13.0.1. markdown-it@13 does
require('punycode') expecting Node's built-in punycode module. React Native's Metro runtime
doesn't ship Node built-ins, so bundling fails:
The package at ".../markdown-it@13.0.2/.../markdown-it/lib/index.js"
attempted to import the Node standard library module "punycode".
It failed because the native React runtime does not include the Node standard library.
> 14 | var punycode = require('punycode');
Import stack:
markdown-it/lib/index.js
@ronradtke/react-native-markdown-display/src/index.js
Cause
markdown-it@14.0.0 replaced require('punycode') with the userland punycode.js package as a
declared dep — specifically because Node deprecated the built-in. v14 is API-compatible with v13
for parser consumers (only internals changed).
Suggested fix
Bump the dep:
// package.json
"dependencies": {
"markdown-it": "^14.0.0"
}
Workaround for consumers stuck on the current version: add a Metro resolver alias forcing
markdown-it to a project-level v14 install.
Environment
- @ronradtke/react-native-markdown-display 8.1.0
- markdown-it 13.0.2 (transitive)
- Expo 56 / Metro 0.84 / React Native 0.83
- bun 1.3.14
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.
current v13 dep uses Node built-in punycode which Metro/RN can't resolve
@ronradtke/react-native-markdown-display@8.1.0 pins markdown-it: ^13.0.1. markdown-it@13 does
require('punycode') expecting Node's built-in punycode module. React Native's Metro runtime
doesn't ship Node built-ins, so bundling fails:
The package at ".../markdown-it@13.0.2/.../markdown-it/lib/index.js"
attempted to import the Node standard library module "punycode".
It failed because the native React runtime does not include the Node standard library.
Import stack:
markdown-it/lib/index.js
@ronradtke/react-native-markdown-display/src/index.js
Cause
markdown-it@14.0.0 replaced require('punycode') with the userland punycode.js package as a
declared dep — specifically because Node deprecated the built-in. v14 is API-compatible with v13
for parser consumers (only internals changed).
Suggested fix
Bump the dep:
// package.json
"dependencies": {
"markdown-it": "^14.0.0"
}
Workaround for consumers stuck on the current version: add a Metro resolver alias forcing
markdown-it to a project-level v14 install.
Environment