Bug : EAGAIN when use `plasmo package`

EAGAIN when using plasmo package
% yarn package --verbose
yarn run v1.22.22
warning package.json: No license field
$ plasmo package --verbose
šŸŸ” 0 | Running command: package
šŸŸ£ Plasmo v0.85.2
šŸ”“ The Browser Extension Framework
šŸ”µ INFO | Prepare to package the extension bundle...
šŸŸ” 1 | Creating Manifest Factory...
šŸŸ” 2 | Ensure exists: /Users/dp/work/extension/.plasmo
šŸŸ” 3 | /Users/dp/work/extension/assets/icon.png found, creating resized icons
šŸŸ” 4 | Creating static templates for popup
šŸŸ” 5 | Creating static templates for options
šŸŸ” 6 | Creating static templates for newtab
šŸŸ” 7 | Creating static templates for devtools
šŸŸ” 8 | Creating static templates for sidepanel

(...)
šŸŸ” 18 | { messageHandlerList: [], portHandlerList: [] }
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest


šŸ”“ ERROR | EAGAIN
šŸŸ” 21 | Error: EAGAIN
at new Worker (node:internal/worker:291:19)
at wk (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:22:13)
at wrkr (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:893:12)
at astrmify (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:930:13)
at new AsyncDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1086:9)
at new AsyncZipDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1949:18)
at file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10563
at new Promise (<anonymous>)
at Qr (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10341)
at async Zh (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:11510)
šŸ”“ EXIT | This program will terminate in 3 seconds...
% yarn package --verbose
yarn run v1.22.22
warning package.json: No license field
$ plasmo package --verbose
šŸŸ” 0 | Running command: package
šŸŸ£ Plasmo v0.85.2
šŸ”“ The Browser Extension Framework
šŸ”µ INFO | Prepare to package the extension bundle...
šŸŸ” 1 | Creating Manifest Factory...
šŸŸ” 2 | Ensure exists: /Users/dp/work/extension/.plasmo
šŸŸ” 3 | /Users/dp/work/extension/assets/icon.png found, creating resized icons
šŸŸ” 4 | Creating static templates for popup
šŸŸ” 5 | Creating static templates for options
šŸŸ” 6 | Creating static templates for newtab
šŸŸ” 7 | Creating static templates for devtools
šŸŸ” 8 | Creating static templates for sidepanel

(...)
šŸŸ” 18 | { messageHandlerList: [], portHandlerList: [] }
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest


šŸ”“ ERROR | EAGAIN
šŸŸ” 21 | Error: EAGAIN
at new Worker (node:internal/worker:291:19)
at wk (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:22:13)
at wrkr (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:893:12)
at astrmify (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:930:13)
at new AsyncDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1086:9)
at new AsyncZipDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1949:18)
at file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10563
at new Promise (<anonymous>)
at Qr (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10341)
at async Zh (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:11510)
šŸ”“ EXIT | This program will terminate in 3 seconds...
It then starts to use a lot of memory
D
dpā€¢43d ago
@lab @LoXatoR fyi
L
labā€¢43d ago
L
labā€¢43d ago
Some resource related issues?
D
dpā€¢42d ago
What is strange it is throwing there -- at new Worker (node:internal/worker:291:19) at wk (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:22:13) at wrkr (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:893:12) at astrmify (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:930:13) at new AsyncDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1086:9) at new AsyncZipDeflate (file:///Users/dp/work/extension/node_modules/fflate/esm/index.mjs:1949:18) at file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10563 at new Promise (<anonymous>) at Qr (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:10341) at async Zh (file:///Users/dp/work/extension/node_modules/plasmo/dist/index.js:166:11510) AsyncZipDeflate
A
Arcaneā€¢42d ago
@dp has reached level 1. GG!
D
dpā€¢42d ago
What would you advise to debug @lab what makes this resource issue? I tried --verbose but nothing; We tried with a VM with 64GB or 128GB and it fails
L
labā€¢42d ago
Seems like simultaneous read/write at the same place or maybe resource unavailable? Actually yeah try running plasmo build then plasmo package Separately
D
dpā€¢42d ago
we already did this; I will add flag verbose; we're running this on github actions;
No description
D
dpā€¢42d ago
cf.
"build": "plasmo build",
"dev": "plasmo dev",
"format:write": "prettier . --write",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"type:check": "tsc --noEmit",
"package": "plasmo package",
"build": "plasmo build",
"dev": "plasmo dev",
"format:write": "prettier . --write",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"type:check": "tsc --noEmit",
"package": "plasmo package",
L
labā€¢42d ago
Try running them in 2 steps
D
dpā€¢42d ago
Ok will try after this attempt Ok will retry with two different steps --
# plasmo build
šŸŸ¢ DONE | Finished in 36524ms!
Done in 44.66s.
yarn run v1.22.22
warning package.json: No license field
# plasmo package
$ plasmo package --verbose
šŸŸ” 0 | Running command: package
šŸŸ£ Plasmo v0.84.1
šŸ”“ The Browser Extension Framework
šŸŸ  WARN | A new version of plasmo is available: v0.85.2
| Run "yarn add plasmo@0.85.2" to update
šŸ”µ INFO | Prepare to package the extension bundle...
šŸŸ” 1 | Creating Manifest Factory...
šŸŸ” 2 | Ensure exists: /home/runner/work/extension/extension/.plasmo
šŸŸ” 3 | /home/runner/work/extension/extension/assets/icon.png found, creating resized icons
šŸŸ” 4 | Creating static templates for popup
(...)
šŸŸ” 14 | Parsed config: { matches: [ '<all_urls>' ], world: 'MAIN', run_at: 'document_start' }
šŸŸ” 15 | Adding content script: /home/runner/work/extension/extension/src/contents/inpage.ts
šŸŸ” 16 | Parsed config: { matches: [ '<all_urls>' ], all_frames: true }
šŸŸ” 17 | Adding content script: /home/runner/work/extension/extension/src/contents/worker.ts
šŸŸ” 18 | { messageHandlerList: [], portHandlerList: [] }
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
# plasmo build
šŸŸ¢ DONE | Finished in 36524ms!
Done in 44.66s.
yarn run v1.22.22
warning package.json: No license field
# plasmo package
$ plasmo package --verbose
šŸŸ” 0 | Running command: package
šŸŸ£ Plasmo v0.84.1
šŸ”“ The Browser Extension Framework
šŸŸ  WARN | A new version of plasmo is available: v0.85.2
| Run "yarn add plasmo@0.85.2" to update
šŸ”µ INFO | Prepare to package the extension bundle...
šŸŸ” 1 | Creating Manifest Factory...
šŸŸ” 2 | Ensure exists: /home/runner/work/extension/extension/.plasmo
šŸŸ” 3 | /home/runner/work/extension/extension/assets/icon.png found, creating resized icons
šŸŸ” 4 | Creating static templates for popup
(...)
šŸŸ” 14 | Parsed config: { matches: [ '<all_urls>' ], world: 'MAIN', run_at: 'document_start' }
šŸŸ” 15 | Adding content script: /home/runner/work/extension/extension/src/contents/inpage.ts
šŸŸ” 16 | Parsed config: { matches: [ '<all_urls>' ], all_frames: true }
šŸŸ” 17 | Adding content script: /home/runner/work/extension/extension/src/contents/worker.ts
šŸŸ” 18 | { messageHandlerList: [], portHandlerList: [] }
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
as it failed here
L
labā€¢42d ago
That's an entirely diff error now :-? And it seems package is using v0.84.1 (which might contain some err btw, iirc, I downgraded some parcel stuffs bc it wasn't working correctly :d )
D
dpā€¢42d ago
I will bump to latest; (this is github actions runners; First log from my machine but it crashes/freezes) Yes it's not exiting and keep going on Github Runner -- Need to stop the job manually
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest
#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0x7c4f096fdcc0
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
šŸŸ” 19 | Creating BGSW entry
šŸŸ” 20 | Hash changed, updating manifest
#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0x7c4f096fdcc0
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
<--- Last few GCs --->
<--- JS stacktrace --->
FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
<--- Last few GCs --->
<--- JS stacktrace --->
#
# Fatal javascript OOM in MemoryChunk allocation failed during deserialization.
#
I am running a new build with plasmo 0.85.2 now
L
labā€¢42d ago
hmm, fyi the package command is basically a simple zip implementation that stream assets/files into the right place
L
labā€¢42d ago
GitHub
plasmo/cli/plasmo/src/commands/package.ts at main Ā· PlasmoHQ/plasmo
šŸ§© The Browser Extension Framework. Contribute to PlasmoHQ/plasmo development by creating an account on GitHub.
L
labā€¢42d ago
You can also just try using the zip command over the build directory
D
dpā€¢42d ago
Ha nice; let me see
A
Arcaneā€¢42d ago
@dp has reached level 2. GG!
L
labā€¢42d ago
I've seen it works with a 30MB bundle so not sure what's going on there, esp when build worked if you can debug and take a look at the package source, feel free to PR!
D
dpā€¢42d ago
Ok it seems our build dir is 402mb; compressed manually with zip makes it 114mb. I will look why this is aas big as that It seems the build node_modules directory include typescript, parcel... and lot of things (sass, react-dev-tools) ; probably we need to move to dev dependencies
D
dpā€¢42d ago
I see the plasmo build CLI just call parcel -- but we can't pass much options to parcel such as yarn build --reporter @parcel/reporter-bundle-analyzer https://github.com/PlasmoHQ/plasmo/blob/main/cli/plasmo/src/commands/build.ts#L38 WOuld it be possible to pass parcel functions?
GitHub
plasmo/cli/plasmo/src/commands/build.ts at main Ā· PlasmoHQ/plasmo
šŸ§© The Browser Extension Framework. Contribute to PlasmoHQ/plasmo development by creating an account on GitHub.
D
dpā€¢42d ago
If you'd like to analyze your bundle, you can use the --bundle-buddy flag, combined with --source-maps to generate a Bundle Buddy Just read it ; nice Ok we just zip it using zip and it worked
A
abhishekjhaā€¢42d ago
We are also facing issue using manual api to upload the zip & sign it. We are able to successfully upload the zip but during sign call it's timing out. Getting below error. An error occurred with your deployment FUNCTION_INVOCATION_TIMEOUT
D
dpā€¢42d ago
@lab
L
labā€¢42d ago
@abhishekjha how big is your extension BTW? the zipped bundle Extended the timeout so you should be able to try again for longer
D
dpā€¢39d ago
100mb I believe But we'l try to reduce it
A
abhishekjhaā€¢38d ago
@lab Still getting timeout
L
labā€¢38d ago
I suggest you reduce the size of your extension - 100mb is too high and I don't think we should support that. Yeah it seems your extension was too large for us to generate a signed bundle for
D
dpā€¢32d ago
Yes it seems our build was keeping node_modules and creating some nested node_modules that was enlarging the directory before zipping.
L
labā€¢31d ago
I think you should try to exclude them and bundle those assets extension doesn't play well with dynamic scripts loading
L
LoXatoRā€¢31d ago
L
LoXatoRā€¢31d ago
Also, it takes around 30 - 45s on average for plasmo dev to recompile and if I stop the dev server and run it again, it keeps re-creating the build and placing it in the existing build folder, thus creating multiple levels of nesting as seen in the pic
No description
L
labā€¢30d ago
That should not be the case, unless there's some crazy introspection/recursion dependency I'd strip out and see which import is messing it up for you
Want results from more Discord servers?
Add your server
More Posts
How to customize parcel config?Hi everyone, I am trying to use a react-native based library called `react-native-reanimated`. This React route is rendered twice when I use useStorage hookHey everyone, I'm having an issue with my extension. I'm using Plasmo and react-router together. WHow can I send a message from BGSW to content script and back?The messaging documentation hardly touches on this issue, the only thing I managed to find is that ITab page injecting CSS into website's runtimeI am devloping my sign in option with tab pages. But if i style the body this directly affect websitSidepanel as maini'm trying to trigger Plasmo SidePanel when user clicks on the extension icon. but i can't get it toMUI styles with PlasmoGetInlineAnchorListStyles are added only for last shadow-root. Please tell me how to make it work. // Plasmo import cTypescript ConfusionI am working on a very simple extension that collects some data off the page and stores it locally. Proxy authentication and API calls afterwardHello, guys. I'm starting to give up. I'm developing proxy extension and proxying works okay. But how do you get a privacy policy when uploading to chrome web store?Most generators that I have searched for online require a link to your website to put in, but since await not definedhey! just trying out the basic extension framework using `create plasmo`. had the basics working, buLogging user errorsAnyone have any suggestions on any libraries or strategies that you use to log errors coming from usNo styling for options.tsxI have a basic options page written in TypeScript and styled via Tailwind CSS that displays perfectlShadcn dosnt seem to work in content script uiI have been trying to get Shadcn to work with CSUI. I followed almost everything from this server aswith-message exampleHow can I get with-message example to fully work? Including communication between tabs and content wHow to mock storageHey guys, im fairly new with plasmo. currently writing e2e tests with playwright. How can i properlytab page works with pnpm run dev but is blocked when i run pnpm build and pnpm packageWhen I upload my zipfile to plasmo itero, none of my users can access the tab page. however It workssupport for multiple assetstrying to do a simple toggle icon extension (click extension to toggle icon) but it seems like only Supabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iSupabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iFirefox dev server manifest warningsThe ```json { "content_security_policy": { "extension_pages": "script-src 'self' http://localh