PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.03k stars 346 forks source link

[BUG] The polyfills in the browser environment is not working #1023

Open chen201724 opened 1 month ago

chen201724 commented 1 month ago

What happened?

The file at https://github.com/PlasmoHQ/plasmo/blob/main/core/parcel-resolver/index.mjs contains polyfills for the browser environment, but the polyfill here does not take effect when there is node:path.

I found that plasmo depend on parcel, however I can solve this problem by declaring an alias in package.json when using parcel. But this method does not work in the plasmo project. Does anyone know how to solve this kind of problem?

Currently, the only solution I can think of is to independently build the package to solve it, but this is obviously not a good solution.

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

Steps to reproduce

pnpm create plasmo react-markdown-demo
cd react-markdown-demo
pnpm install react-markdown
pnpm run dev
// popup.tsx
import ReactMarkdown from "react-markdown"

function IndexPopup() {
  return (
    <div>
      <ReactMarkdown>Hello, World</ReactMarkdown>
    </div>
  )
}

export default IndexPopup

(OPTIONAL) Contribution

Code of Conduct

JinliG commented 1 month ago

@chen201724 same problem. See this #960,it seems that parcel needs an upgrade.