[GH-ISSUE #2351] [BUG]: Application is not opening in macbook pro m2 #1534

Closed
opened 2026-02-22 18:25:18 -05:00 by yindo · 1 comment
Owner

Originally created by @aslyheer on GitHub (Sep 23, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2351

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

STDERR: node:electron/js2c/asar_bundle:2
(()=>{"use strict";var t={"./lib/asar/fs-wrapper.ts":(t,e,s)=>{var r=s("./lib/common/webpack-provider.ts").process,n=s("./lib/common/webpack-provider.ts")._global;Object.defineProperty(e,"__esModule",{value:!0}),e.wrapFsWithAsar=void 0;const i=s("buffer"),a=s("path"),o=s("util"),c=r._linkedBinding("electron_common_asar"),f=s("module"),l=n.Promise,u=r.env.ELECTRON_NO_ASAR&&"browser"!==r.type&&"renderer"!==r.type,h=r.internalBinding;delete r.internalBinding;const nextTick=(t,e=[])=>{r.nextTick((()=>t(...e)))},p=new Map,getOrCreateArchive=t=>{if(p.has(t))return p.get(t);try{const e=new c.Archive(t);return p.set(t,e),e}catch{return null}};r.getOrCreateArchive=getOrCreateArchive;const d=/.asar/i,splitPath=t=>{if(r.noAsar||u)return{isAsar:!1};let e=t;return i.Buffer.isBuffer(t)&&(e=t.toString()),"string"!=typeof e?{isAsar:!1}:d.test(e)?c.splitPath(a.normalize(e)):{isAsar:!1}};let y=0;const =r.getuid?.()??0,P=r.getgid?.()??0,A=new Date,asarStatsToFsStats=function(t){const{Stats:e,constants:r}=s("fs");let n=r.S_IROTH^r.S_IRGRP^r.S_IRUSR^r.S_IWUSR;return t.isFile?n^=r.S_IFREG:t.isDirectory?n^=r.S_IFDIR:t.isLink&&(n^=r.S_IFLNK),new e(1,n,1,,P,0,void 0,++y,t.size,void 0,A.getTime(),A.getTime(),A.getTime(),A.getTime())},createError=(t,{asarPath:e,filePath:s}={})=>{let r;switch(t){case"NOT_FOUND":r=new Error(ENOENT, ${s} not found in ${e}),r.code="ENOENT",r.errno=-2;break;case"NOT_DIR":r=new Error("ENOTDIR, not a directory"),r.code="ENOTDIR",r.errno=-20;break;case"NO_ACCESS":r=new Error(EACCES: permission denied, access '${s}'),r.code="EACCES",r.errno=-13;break;case"INVALID_ARCHIVE":r=new Error(Invalid package ${e});break;default:throw new Error(Invalid error type "${t}" passed to createError.)}return r},overrideAPISync=function(t,e,s,r=!1){null==s&&(s=0);const n=t[e],func=function(...t){const e=t[s],r=splitPath(e);if(!r.isAsar)return n.apply(this,t);const{asarPath:i,filePath:a}=r,o=getOrCreateArchive(i);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:i});const c=o.copyFileOut(a);if(!c)throw createError("NOT_FOUND",{asarPath:i,filePath:a});return t[s]=c,n.apply(this,t)};if(r)return func;t[e]=func},overrideAPI=function(t,e,s){null==s&&(s=0);const r=t[e];t[e]=function(...n){const i=n[s],a=splitPath(i);if(!a.isAsar)return r.apply(this,n);const{asarPath:o,filePath:c}=a,f=n[n.length-1];if("function"!=typeof f)return overrideAPISync(t,e,s,!0).apply(this,n);const l=getOrCreateArchive(o);if(!l){const t=createError("INVALID_ARCHIVE",{asarPath:o});return void nextTick(f,[t])}const u=l.copyFileOut(c);if(u)return n[s]=u,r.apply(this,n);{const t=createError("NOT_FOUND",{asarPath:o,filePath:c});nextTick(f,[t])}},r[o.promisify.custom]&&(t[e][o.promisify.custom]=makePromiseFunction(r[o.promisify.custom],s)),t.promises&&t.promises[e]&&(t.promises[e]=makePromiseFunction(t.promises[e],s))};let I;function validateBufferIntegrity(t,e){if(!e)return;I=I||s("crypto");const n=I.createHash(e.algorithm).update(t).digest("hex");n!==e.hash&&(console.error(ASAR Integrity Violation: got a hash mismatch (${n} vs ${e.hash})),r.exit(1))}const makePromiseFunction=function(t,e){return function(...s){const r=s[e],n=splitPath(r);if(!n.isAsar)return t.apply(this,s);const{asarPath:i,filePath:a}=n,o=getOrCreateArchive(i);if(!o)return l.reject(createError("INVALID_ARCHIVE",{asarPath:i}));const c=o.copyFileOut(a);return c?(s[e]=c,t.apply(this,s)):l.reject(createError("NOT_FOUND",{asarPath:i,filePath:a}))}};e.wrapFsWithAsar=t=>{const e=new Map,logASARAccess=(n,i,a)=>{if(r.env.ELECTRON_LOG_ASAR_READS){if(!e.has(n)){const r=s("path"),i=${r.basename(n,".asar")}-access-log.txt,a=r.join(s("os").tmpdir(),i);e.set(n,t.openSync(a,"a"))}t.writeSync(e.get(n),${a}: ${i}\n)}},{lstatSync:n}=t;t.lstatSync=(t,e)=>{const s=splitPath(t);if(!s.isAsar)return n(t,e);const{asarPath:r,filePath:i}=s,a=getOrCreateArchive(r);if(!a)throw createError("INVALID_ARCHIVE",{asarPath:r});const o=a.stat(i);if(!o)throw createError("NOT_FOUND",{asarPath:r,filePath:i});return asarStatsToFsStats(o)};const{lstat:c}=t;t.lstat=(t,e,s)=>{const r=splitPath(t);if("function"==typeof e&&(s=e,e={}),!r.isAsar)return c(t,e,s);const{asarPath:n,filePath:i}=r,a=getOrCreateArchive(n);if(!a){const t=createError("INVALID_ARCHIVE",{asarPath:n});return void nextTick(s,[t])}const o=a.stat(i);if(!o){const t=createError("NOT_FOUND",{asarPath:n,filePath:i});return void nextTick(s,[t])}const f=asarStatsToFsStats(o);nextTick(s,[null,f])},t.promises.lstat=o.promisify(t.lstat);const{statSync:u}=t;t.statSync=(e,s)=>{const{isAsar:r}=splitPath(e);return r?t.lstatSync(e,s):u(e,s)};const{stat:p}=t;t.stat=(e,s,n)=>{const{isAsar:i}=splitPath(e);if("function"==typeof s&&(n=s,s={}),!i)return p(e,s,n);r.nextTick((()=>t.lstat(e,s,n)))},t.promises.stat=o.promisify(t.stat);const wrapRealpathSync=function(t){return function(e,s){const r=splitPath(e);if(!r.isAsar)return t.apply(this,arguments);const{asarPath:n,filePath:i}=r,o=getOrCreateArchive(n);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:n});const c=o.realpath(i);if(!1===c)throw createError("NOT_FOUND",{asarPath:n,filePath:i});return a.join(t(n,s),c)}},{realpathSync:d}=t;t.realpathSync=wrapRealpathSync(d),t.realpathSync.native=wrapRealpathSync(d.native);const wrapRealpath=function(t){return function(e,s,r){const n=splitPath(e);if(!n.isAsar)return t.apply(this,arguments);const{asarPath:i,filePath:o}=n;arguments.length<3&&(r=s,s={});const c=getOrCreateArchive(i);if(!c){const t=createError("INVALID_ARCHIVE",{asarPath:i});return void nextTick(r,[t])}const f=c.realpath(o);if(!1!==f)t(i,s,((t,e)=>{if(null===t){const t=a.join(e,f);r(null,t)}else r(t)}));else{const t=createError("NOT_FOUND",{asarPath:i,filePath:o});nextTick(r,[t])}}},{realpath:y}=t;t.realpath=wrapRealpath(y),t.realpath.native=wrapRealpath(y.native),t.promises.realpath=o.promisify(t.realpath.native);const{exists:}=t;t.exists=function exists(t,e){const s=splitPath(t);if(!s.isAsar)return _(t,e);const{asarPath:r,filePath:n}=s,i=getOrCreateArchive(r);if(!i){const t=createError("INVALID_ARCHIVE",{asarPath:r});return void nextTick(e,[t])}const a=!1!==i.stat(n);nextTick(e,[a])},t.exists[o.promisify.custom]=function exists(t){const e=splitPath(t);if(!e.isAsar)return _o.promisify.custom;const{asarPath:s,filePath:r}=e,n=getOrCreateArchive(s);if(!n){const t=createError("INVALID_ARCHIVE",{asarPath:s});return l.reject(t)}return l.resolve(!1!==n.stat(r))};const{existsSync:P}=t;t.existsSync=t=>{const e=splitPath(t);if(!e.isAsar)return P(t);const{asarPath:s,filePath:r}=e,n=getOrCreateArchive(s);return!!n&&!1!==n.stat(r)};const{access:A}=t;t.access=function(e,s,r){const n=splitPath(e);if(!n.isAsar)return A.apply(this,arguments);const{asarPath:i,filePath:a}=n;"function"==typeof s&&(r=s,s=t.constants.F_OK);const o=getOrCreateArchive(i);if(!o){const t=createError("INVALID_ARCHIVE",{asarPath:i});return void nextTick(r,[t])}const c=o.getFileInfo(a);if(!c){const t=createError("NOT_FOUND",{asarPath:i,filePath:a});return void nextTick(r,[t])}if(c.unpacked){const e=o.copyFileOut(a);return t.access(e,s,r)}const f=o.stat(a);if(f)if(s&t.constants.W_OK){const t=createError("NO_ACCESS",{asarPath:i,filePath:a});nextTick(r,[t])}else nextTick(r);else{const t=createError("NOT_FOUND",{asarPath:i,filePath:a});nextTick(r,[t])}},t.promises.access=o.promisify(t.access);const{accessSync:I}=t;function fsReadFileAsar(e,s,r){const n=splitPath(e);if(n.isAsar){const{asarPath:e,filePath:a}=n;if("function"==typeof s)r=s,s={encoding:null};else if("string"==typeof s)s={encoding:s};else if(null==s)s={encoding:null};else if("object"!=typeof s)throw new TypeError("Bad arguments");const{encoding:o}=s,c=getOrCreateArchive(e);if(!c){const t=createError("INVALID_ARCHIVE",{asarPath:e});return void nextTick(r,[t])}const f=c.getFileInfo(a);if(!f){const t=createError("NOT_FOUND",{asarPath:e,filePath:a});return void nextTick(r,[t])}if(0===f.size)return void nextTick(r,[null,o?"":i.Buffer.alloc(0)]);if(f.unpacked){const e=c.copyFileOut(a);return t.readFile(e,s,r)}const l=i.Buffer.alloc(f.size),u=c.getFdAndValidateIntegrityLater();if(!(u>=0)){const t=createError("NOT_FOUND",{asarPath:e,filePath:a});return void nextTick(r,[t])}logASARAccess(e,a,f.offset)

Are there known steps to reproduce?

No response

Originally created by @aslyheer on GitHub (Sep 23, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2351 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? STDERR: node:electron/js2c/asar_bundle:2 (()=>{"use strict";var t={"./lib/asar/fs-wrapper.ts":(t,e,s)=>{var r=s("./lib/common/webpack-provider.ts").process,n=s("./lib/common/webpack-provider.ts")._global;Object.defineProperty(e,"__esModule",{value:!0}),e.wrapFsWithAsar=void 0;const i=s("buffer"),a=s("path"),o=s("util"),c=r._linkedBinding("electron_common_asar"),f=s("module"),l=n.Promise,u=r.env.ELECTRON_NO_ASAR&&"browser"!==r.type&&"renderer"!==r.type,h=r.internalBinding;delete r.internalBinding;const nextTick=(t,e=[])=>{r.nextTick((()=>t(...e)))},p=new Map,getOrCreateArchive=t=>{if(p.has(t))return p.get(t);try{const e=new c.Archive(t);return p.set(t,e),e}catch{return null}};r._getOrCreateArchive=getOrCreateArchive;const d=/\.asar/i,splitPath=t=>{if(r.noAsar||u)return{isAsar:!1};let e=t;return i.Buffer.isBuffer(t)&&(e=t.toString()),"string"!=typeof e?{isAsar:!1}:d.test(e)?c.splitPath(a.normalize(e)):{isAsar:!1}};let y=0;const _=r.getuid?.()??0,P=r.getgid?.()??0,A=new Date,asarStatsToFsStats=function(t){const{Stats:e,constants:r}=s("fs");let n=r.S_IROTH^r.S_IRGRP^r.S_IRUSR^r.S_IWUSR;return t.isFile?n^=r.S_IFREG:t.isDirectory?n^=r.S_IFDIR:t.isLink&&(n^=r.S_IFLNK),new e(1,n,1,_,P,0,void 0,++y,t.size,void 0,A.getTime(),A.getTime(),A.getTime(),A.getTime())},createError=(t,{asarPath:e,filePath:s}={})=>{let r;switch(t){case"NOT_FOUND":r=new Error(`ENOENT, ${s} not found in ${e}`),r.code="ENOENT",r.errno=-2;break;case"NOT_DIR":r=new Error("ENOTDIR, not a directory"),r.code="ENOTDIR",r.errno=-20;break;case"NO_ACCESS":r=new Error(`EACCES: permission denied, access '${s}'`),r.code="EACCES",r.errno=-13;break;case"INVALID_ARCHIVE":r=new Error(`Invalid package ${e}`);break;default:throw new Error(`Invalid error type "${t}" passed to createError.`)}return r},overrideAPISync=function(t,e,s,r=!1){null==s&&(s=0);const n=t[e],func=function(...t){const e=t[s],r=splitPath(e);if(!r.isAsar)return n.apply(this,t);const{asarPath:i,filePath:a}=r,o=getOrCreateArchive(i);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:i});const c=o.copyFileOut(a);if(!c)throw createError("NOT_FOUND",{asarPath:i,filePath:a});return t[s]=c,n.apply(this,t)};if(r)return func;t[e]=func},overrideAPI=function(t,e,s){null==s&&(s=0);const r=t[e];t[e]=function(...n){const i=n[s],a=splitPath(i);if(!a.isAsar)return r.apply(this,n);const{asarPath:o,filePath:c}=a,f=n[n.length-1];if("function"!=typeof f)return overrideAPISync(t,e,s,!0).apply(this,n);const l=getOrCreateArchive(o);if(!l){const t=createError("INVALID_ARCHIVE",{asarPath:o});return void nextTick(f,[t])}const u=l.copyFileOut(c);if(u)return n[s]=u,r.apply(this,n);{const t=createError("NOT_FOUND",{asarPath:o,filePath:c});nextTick(f,[t])}},r[o.promisify.custom]&&(t[e][o.promisify.custom]=makePromiseFunction(r[o.promisify.custom],s)),t.promises&&t.promises[e]&&(t.promises[e]=makePromiseFunction(t.promises[e],s))};let I;function validateBufferIntegrity(t,e){if(!e)return;I=I||s("crypto");const n=I.createHash(e.algorithm).update(t).digest("hex");n!==e.hash&&(console.error(`ASAR Integrity Violation: got a hash mismatch (${n} vs ${e.hash})`),r.exit(1))}const makePromiseFunction=function(t,e){return function(...s){const r=s[e],n=splitPath(r);if(!n.isAsar)return t.apply(this,s);const{asarPath:i,filePath:a}=n,o=getOrCreateArchive(i);if(!o)return l.reject(createError("INVALID_ARCHIVE",{asarPath:i}));const c=o.copyFileOut(a);return c?(s[e]=c,t.apply(this,s)):l.reject(createError("NOT_FOUND",{asarPath:i,filePath:a}))}};e.wrapFsWithAsar=t=>{const e=new Map,logASARAccess=(n,i,a)=>{if(r.env.ELECTRON_LOG_ASAR_READS){if(!e.has(n)){const r=s("path"),i=`${r.basename(n,".asar")}-access-log.txt`,a=r.join(s("os").tmpdir(),i);e.set(n,t.openSync(a,"a"))}t.writeSync(e.get(n),`${a}: ${i}\n`)}},{lstatSync:n}=t;t.lstatSync=(t,e)=>{const s=splitPath(t);if(!s.isAsar)return n(t,e);const{asarPath:r,filePath:i}=s,a=getOrCreateArchive(r);if(!a)throw createError("INVALID_ARCHIVE",{asarPath:r});const o=a.stat(i);if(!o)throw createError("NOT_FOUND",{asarPath:r,filePath:i});return asarStatsToFsStats(o)};const{lstat:c}=t;t.lstat=(t,e,s)=>{const r=splitPath(t);if("function"==typeof e&&(s=e,e={}),!r.isAsar)return c(t,e,s);const{asarPath:n,filePath:i}=r,a=getOrCreateArchive(n);if(!a){const t=createError("INVALID_ARCHIVE",{asarPath:n});return void nextTick(s,[t])}const o=a.stat(i);if(!o){const t=createError("NOT_FOUND",{asarPath:n,filePath:i});return void nextTick(s,[t])}const f=asarStatsToFsStats(o);nextTick(s,[null,f])},t.promises.lstat=o.promisify(t.lstat);const{statSync:u}=t;t.statSync=(e,s)=>{const{isAsar:r}=splitPath(e);return r?t.lstatSync(e,s):u(e,s)};const{stat:p}=t;t.stat=(e,s,n)=>{const{isAsar:i}=splitPath(e);if("function"==typeof s&&(n=s,s={}),!i)return p(e,s,n);r.nextTick((()=>t.lstat(e,s,n)))},t.promises.stat=o.promisify(t.stat);const wrapRealpathSync=function(t){return function(e,s){const r=splitPath(e);if(!r.isAsar)return t.apply(this,arguments);const{asarPath:n,filePath:i}=r,o=getOrCreateArchive(n);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:n});const c=o.realpath(i);if(!1===c)throw createError("NOT_FOUND",{asarPath:n,filePath:i});return a.join(t(n,s),c)}},{realpathSync:d}=t;t.realpathSync=wrapRealpathSync(d),t.realpathSync.native=wrapRealpathSync(d.native);const wrapRealpath=function(t){return function(e,s,r){const n=splitPath(e);if(!n.isAsar)return t.apply(this,arguments);const{asarPath:i,filePath:o}=n;arguments.length<3&&(r=s,s={});const c=getOrCreateArchive(i);if(!c){const t=createError("INVALID_ARCHIVE",{asarPath:i});return void nextTick(r,[t])}const f=c.realpath(o);if(!1!==f)t(i,s,((t,e)=>{if(null===t){const t=a.join(e,f);r(null,t)}else r(t)}));else{const t=createError("NOT_FOUND",{asarPath:i,filePath:o});nextTick(r,[t])}}},{realpath:y}=t;t.realpath=wrapRealpath(y),t.realpath.native=wrapRealpath(y.native),t.promises.realpath=o.promisify(t.realpath.native);const{exists:_}=t;t.exists=function exists(t,e){const s=splitPath(t);if(!s.isAsar)return _(t,e);const{asarPath:r,filePath:n}=s,i=getOrCreateArchive(r);if(!i){const t=createError("INVALID_ARCHIVE",{asarPath:r});return void nextTick(e,[t])}const a=!1!==i.stat(n);nextTick(e,[a])},t.exists[o.promisify.custom]=function exists(t){const e=splitPath(t);if(!e.isAsar)return _[o.promisify.custom](t);const{asarPath:s,filePath:r}=e,n=getOrCreateArchive(s);if(!n){const t=createError("INVALID_ARCHIVE",{asarPath:s});return l.reject(t)}return l.resolve(!1!==n.stat(r))};const{existsSync:P}=t;t.existsSync=t=>{const e=splitPath(t);if(!e.isAsar)return P(t);const{asarPath:s,filePath:r}=e,n=getOrCreateArchive(s);return!!n&&!1!==n.stat(r)};const{access:A}=t;t.access=function(e,s,r){const n=splitPath(e);if(!n.isAsar)return A.apply(this,arguments);const{asarPath:i,filePath:a}=n;"function"==typeof s&&(r=s,s=t.constants.F_OK);const o=getOrCreateArchive(i);if(!o){const t=createError("INVALID_ARCHIVE",{asarPath:i});return void nextTick(r,[t])}const c=o.getFileInfo(a);if(!c){const t=createError("NOT_FOUND",{asarPath:i,filePath:a});return void nextTick(r,[t])}if(c.unpacked){const e=o.copyFileOut(a);return t.access(e,s,r)}const f=o.stat(a);if(f)if(s&t.constants.W_OK){const t=createError("NO_ACCESS",{asarPath:i,filePath:a});nextTick(r,[t])}else nextTick(r);else{const t=createError("NOT_FOUND",{asarPath:i,filePath:a});nextTick(r,[t])}},t.promises.access=o.promisify(t.access);const{accessSync:I}=t;function fsReadFileAsar(e,s,r){const n=splitPath(e);if(n.isAsar){const{asarPath:e,filePath:a}=n;if("function"==typeof s)r=s,s={encoding:null};else if("string"==typeof s)s={encoding:s};else if(null==s)s={encoding:null};else if("object"!=typeof s)throw new TypeError("Bad arguments");const{encoding:o}=s,c=getOrCreateArchive(e);if(!c){const t=createError("INVALID_ARCHIVE",{asarPath:e});return void nextTick(r,[t])}const f=c.getFileInfo(a);if(!f){const t=createError("NOT_FOUND",{asarPath:e,filePath:a});return void nextTick(r,[t])}if(0===f.size)return void nextTick(r,[null,o?"":i.Buffer.alloc(0)]);if(f.unpacked){const e=c.copyFileOut(a);return t.readFile(e,s,r)}const l=i.Buffer.alloc(f.size),u=c.getFdAndValidateIntegrityLater();if(!(u>=0)){const t=createError("NOT_FOUND",{asarPath:e,filePath:a});return void nextTick(r,[t])}logASARAccess(e,a,f.offset) ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:25:18 -05:00
yindo closed this issue 2026-02-22 18:25:18 -05:00
Author
Owner

@timothycarambat commented on GitHub (Sep 23, 2024):

Certainly unable to replicate on another MBP machine. When you download the DMG are you mounting it to an external disk or something like that? Have downloaded and mounted 3 times and no issues on two different MBP. Closed until we can trace root cause, but keeping convo open to debug

@timothycarambat commented on GitHub (Sep 23, 2024): Certainly unable to replicate on another MBP machine. When you download the DMG are you mounting it to an external disk or something like that? Have downloaded and mounted 3 times and no issues on two different MBP. Closed until we can trace root cause, but keeping convo open to debug
yindo changed title from [BUG]: Application is not opening in macbook pro m2 to [GH-ISSUE #2351] [BUG]: Application is not opening in macbook pro m2 2026-06-05 14:41:17 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1534