PlasmoHQ / plasmo

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

[BUG] 🔴 ERROR | Could not resolve module "node:os" #743

Open pomcho555 opened 1 year ago

pomcho555 commented 1 year ago

What happened?

When updating plasmo from 0.76.3 to 0.82.1, cosmiconfig is also updated from 8.2.0 to 8.3.2(typescript@5.1.6). And then I tried to build my extension though pnpm build after succession of pnpm dev. But I got the error belew while the build. BTW this error also came out with npm

[BUG] 🔴 ERROR  | Could not resolve module "node:os" from "/Users/john/workspace/project/node\_modules/.pnpm/cosmiconfig@8.3.2\_typescript@5.1.6/node\_modules/cosmiconfig/dist/index.js"

As the workaround I downgrade the plasma and cosmiconfig to previous version I used by manually hard-coding package.json and pnpm-lock.json and it works somehow.

I don't know where the root-cause comes from but at least cosmiconfig version may cause something wrong on my laptop.

NOTE: I'm using Apple silicon but no idea it matters.

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contribution

Code of Conduct

smolak commented 1 year ago

This is the main issue behind this. For me, downgrading to plasmo v0.75.3, as a workaround, seems to be working. Mind this is not an ideal solution.

Changlon commented 1 year ago

I have the same question? does this fixed??

louisgv commented 1 year ago

Will likely need to wait until upstream fix the dependency... or would someone wanna try putting up a PR forking that htmlnano optimizer? :d...

smolak commented 1 year ago

So this fixed this which if applied in Plasmo, will get rid of the issue.

smolak commented 1 year ago

I installed the latest (v0.83.0) and it's working (both dev and build tasks, using npm).