machi
machi2mo ago

I have a problem with esbuild. I'm

I have a problem with esbuild. I'm trying to use the unified with remark-parse on server side. It uses nested dependency decode-named-character-reference which has multiple exports dependent on platform. ESBuild set platform to "browser", which causes push to fail because it tries to bundle index.dom.js instead of index.js.
Failed to analyze xxx.js: Uncaught ReferenceError: document is not defined
at <anonymous> (../node_modules/decode-named-character-reference/index.dom.js:10:16)
Failed to analyze xxx.js: Uncaught ReferenceError: document is not defined
at <anonymous> (../node_modules/decode-named-character-reference/index.dom.js:10:16)
"exports": {
"deno": "./index.js",
"edge-light": "./index.js",
"react-native": "./index.js",
"worker": "./index.js",
"workerd": "./index.js",
"browser": "./index.dom.js",
"default": "./index.js"
},
"exports": {
"deno": "./index.js",
"edge-light": "./index.js",
"react-native": "./index.js",
"worker": "./index.js",
"workerd": "./index.js",
"browser": "./index.dom.js",
"default": "./index.js"
},
Is there any way to mitigate that?
3 Replies
machi
machiOP2mo ago
@Jamie Maybe you could help me out navigating this one?
erquhart
erquhart2mo ago
generally want to avoid at-mentioning folks - opening a post in #support-community is the way to get help
machi
machiOP2mo ago
@erquhart Ah sorry newcomer will remember

Did you find this page helpful?