You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
remark-stringify
Link to runnable example
No response
Steps to reproduce
Import remark-stringify into a browser extension's background service worker script. The script initialization will fail immediately with error "document is not defined".
I checked the code, it seems like there is a use of document.createElement("i"), I'm not sure what it's for.
Expected behavior
It should work fine in service worker environment and does not depend on DOM API.
Actual behavior
It depends on document and fails in non-DOM environment.
Runtime
Node v16
Package manager
yarn 1
OS
macOS
Build and bundle tools
esbuild
The text was updated successfully, but these errors were encountered:
You can configure your bundler. It only does this if you say it is running in a browser (browsers have a document), it doesn't do so in places that have no document (node, deno, worker, react-native).
Initial checklist
Affected packages and versions
remark-stringify
Link to runnable example
No response
Steps to reproduce
Import
remark-stringify
into a browser extension's background service worker script. The script initialization will fail immediately with error "document is not defined".I checked the code, it seems like there is a use of
document.createElement("i")
, I'm not sure what it's for.Expected behavior
It should work fine in service worker environment and does not depend on DOM API.
Actual behavior
It depends on
document
and fails in non-DOM environment.Runtime
Node v16
Package manager
yarn 1
OS
macOS
Build and bundle tools
esbuild
The text was updated successfully, but these errors were encountered: