plasmo dev is failing

here is the verbose output
(...)
🟑 4 | @plasmohq/optimizer-es: tabs/import-wallet-with-socials.a896c681.js tabs/import-wallet-with-socials.[hash].js /Users/dp/work/extension
🟑 5 | optimizer-es: skipped
(...)
🟑 9 | optimizer-es: skipped
/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1
var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var e in r)a(o,e,{get:r[e],enumerable:!0})},c=(o,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of p(r))!u.call(o,t)&&t!==e&&a(o,t,{get:()=>r[t],enumerable:!(n=d(r,t))||n.enumerable});return o};var C=o=>c(a({},"__esModule",{value:!0}),o);var g={};l(g,{default:()=>h});module.exports=C(g);var i=require("@parcel/plugin");var m=require("stream"),f=require("string_decoder"),s=class extends m.Transform{decoder=new f.StringDecoder("utf8");_transform(r,e,n){n(null,this.transformChunk(this.decoder.write(r)))}_flush(r){let e=this.decoder.end();e?r(null,this.transformChunk(e)):r()}transformChunk(r){return Array.from(r).map(e=>e.charCodeAt(0)<=127?e:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)).join("")}};var h=new i.Compressor({async compress({stream:o}){return{stream:o.pipe(new s)}}});


RangeError: Invalid array length
at Function.from (<anonymous>)
at s.transformChunk (/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1:783)
at s._transform (/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1:641)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:564:12)
at _write (node:internal/streams/writable:493:10)(...)
at Readable.emit (node:events:518:28)
at Readable.read (node:internal/streams/readable:780:10)
(...)
🟑 4 | @plasmohq/optimizer-es: tabs/import-wallet-with-socials.a896c681.js tabs/import-wallet-with-socials.[hash].js /Users/dp/work/extension
🟑 5 | optimizer-es: skipped
(...)
🟑 9 | optimizer-es: skipped
/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1
var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var e in r)a(o,e,{get:r[e],enumerable:!0})},c=(o,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of p(r))!u.call(o,t)&&t!==e&&a(o,t,{get:()=>r[t],enumerable:!(n=d(r,t))||n.enumerable});return o};var C=o=>c(a({},"__esModule",{value:!0}),o);var g={};l(g,{default:()=>h});module.exports=C(g);var i=require("@parcel/plugin");var m=require("stream"),f=require("string_decoder"),s=class extends m.Transform{decoder=new f.StringDecoder("utf8");_transform(r,e,n){n(null,this.transformChunk(this.decoder.write(r)))}_flush(r){let e=this.decoder.end();e?r(null,this.transformChunk(e)):r()}transformChunk(r){return Array.from(r).map(e=>e.charCodeAt(0)<=127?e:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)).join("")}};var h=new i.Compressor({async compress({stream:o}){return{stream:o.pipe(new s)}}});


RangeError: Invalid array length
at Function.from (<anonymous>)
at s.transformChunk (/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1:783)
at s._transform (/Users/dp/work/extension/node_modules/@plasmohq/parcel-compressor-utf8/dist/index.js:1:641)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:564:12)
at _write (node:internal/streams/writable:493:10)(...)
at Readable.emit (node:events:518:28)
at Readable.read (node:internal/streams/readable:780:10)
3 Replies
dp
dpOPβ€’8mo ago
@lab any hints? Thank you
YAGPDB.xyz
YAGPDB.xyzβ€’8mo ago
Gave +1 Rep to @lab (current: #1 - 169)
lab
labβ€’8mo ago
@dp this happens with the optimizer, it basically traverse through the bundle to minify code You might need to break your tab into smaller component and maybe lazy load some stuff I'd do a bundle analyzer on those
Want results from more Discord servers?
Add your server