altSessionJsonPath execption: path is not a string #1266
gnadelwartz posted onGitHub
Describe the bug After Update to 3.1.15 I get an execption when WA-Automate loads the session on startup 1.3.13 is working.
create() code This is the code you use to create the client. e.g
create(...)
Expected behavior no execprion ;-)
DEBUG INFO This is the info printed to the console when you start your app. It should look like this
ā WA_VERSION ā '2.2100.6' ā
ā PAGE_UA ā 'WhatsApp/2.2037.6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36' ā
ā WA_AUTOMATE_VERSION ā '3.1.15' ā
ā BROWSER_VERSION ā 'HeadlessChrome/88.0.4298.0' ā
ā OS ā 'Linux 5.3' ā
ā START_TS ā 1611333653610 ā
Screenshots
If applicable, add screenshots to help explain your problem. Use headless: false
to get screenshots
Additional context Add any other context about the problem here.
seems to boil down to initalisation of altSessionJsonPath
in node-modules/@open-wa/wa-automate/dist/controllers/initializer.js
.
My temporary fix ist to set altSessionJsonPath
to an empty string in line 313
altSessionJsonPath = "" //((config === null || config === void 0 ? void 0 : config.sessionDataPath) && (config === null || config === void 0 ? void 0 : config.sessionDataPath.includes('.data.json'))) ? path.join(path.resolve(require.main.path, (config === null || config === void 0 ? void 0 : config.sessionDataPath) || '')) : path.join(path.resolve(require.main.path, (config === null || config === void 0 ? void 0 : config.sessionDataPath) || ''), (sessionId || 'session') + ".data.json");
sessionjsonpath = fs.existsSync(altSessionJsonPath) ? altSessionJsonPath : stdSessionJsonPath;
After this I can at least start my WA BOT
Ah, have to mention that everthing is in and run in one flat dir, no src subdir etc., only node-modules
-r-xr-xr-x 2068 22. Jan 15:28 dealwaecho.rc
-rw-r--r-- 6858 22. Jan 15:30 dealwaecho.ts
-rw-r--r-- 476 1. Feb 2020 .eslintrc.json
drwxr-xr-x 20480 22. Jan 17:32 node_modules
-rw-r--r-- 210837 22. Jan 17:32 package-lock.json
-rw-r--r-- 544 22. Jan 17:40 session.data.json