PlasmoHQ / plasmo

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

[BUG] plasmo dev -> Malloc ERROR on MacBook m3 #1060

Open quentin-aslan opened 2 months ago

quentin-aslan commented 2 months ago

What happened?

A bug happened!

I use a macbook air m3 (8gb) and when I init a project with pnpm create plasmo or plasmo init and I tried to start the project witn pnpm dev or plasmo dev. I have there error : Check -> 'Relevant log output' below

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

No response

Relevant log output

🟣 Plasmo v0.89.1
🔴 The Browser Extension Framework
🔵 INFO   | Starting the extension development server...
🔵 INFO   | Building for target: chrome-mv3
🔵 INFO   | Loaded environment variables from: []
(node:980) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
node(980,0x173497000) malloc: Incorrect checksum for freed object 0x156342c00: probably modified after being freed.
Corrupt value: 0x0
node(980,0x172c7f000) malloc: Incorrect checksum for freed object 0x127bcd800: probably modified after being freed.
Corrupt value: 0x80b00000000
node(980,0x173497000) malloc: *** set a breakpoint in malloc_error_break to debug
node(980,0x172c7f000) malloc: *** set a breakpoint in malloc_error_break to debug
 ELIFECYCLE  Command failed.
zsh: abort      pnpm dev

(OPTIONAL) Contribution

Code of Conduct

Riobigdan commented 2 months ago

尝试使用 --max-old-space-size 参数增加 Node.js 的内存限制: NODE_OPTIONS=--max-old-space-size=4096 pnpm dev

Riobigdan commented 2 months ago

尝试使用 --max-old-space-size 参数增加 Node.js 的内存限制: NODE_OPTIONS=--max-old-space-size=4096 pnpm dev

并非解决问题 只是临时处理

quentin-aslan commented 2 months ago

Hi, it doesnt fix my issue, but I found a fix : use node v20 instead of node v22.

I use nvm to manage the node version :

  1. https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
  2. Open your terminal and type : 2.1. nvm install 20 2.2. nvm use 20
  3. Start the app
HowieG commented 2 months ago

Having this issue as well

HowieG commented 2 months ago

Hi, it doesnt fix my issue, but I found a fix : use node v20 instead of node v22.

I use nvm to manage the node version :

  1. https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
  2. Open your terminal and type : 2.1. nvm install 20 2.2. nvm use 20
  3. Start the app

This worked for me thanks

steipete commented 1 month ago

I am running into the same issue. Downgrading to node 21 or 20 works, but doesn't seem like a great fix.

Update: I reported this to the node repo, seems a regression introduced in 22.7.

steipete commented 1 month ago

This doesn't seem to be a Node issue but something in Plasmo, according to the Node maintainers in https://github.com/nodejs/node/issues/55145.

cloudchamb3r commented 1 month ago

I have the same error. I found that the error is occured in this line. However, I can't easily determine which is causing the problem (plasmo, parcel or node).