This unexpected side-effect is causing issues when we want to use the in-memory storage. In my case we ran it in a serverless environment that have limited access to the file-system.
The following exceptions is thrown:
Error: ENOENT: no such file or directory, mkdir '/var/task/localStorage'", " at Object.mkdirSync (fs.js:1013:3)", " at LocalStorage._init (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+node-localstorage@2.2.1/node_modules/node-localstorage/LocalStorage.js:183:14)", " at new LocalStorage (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+node-localstorage@2.2.1/node_modules/node-localstorage/LocalStorage.js:124:12)", " at new LocalStorageFactory (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:178:27)", " at new Config (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:274:89)", " at gateway (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:3940:21)
As part of https://github.com/moltin/js-sdk/commit/c60f3d9e07061b851e095269d888fdf0692dd650 a side-effect was introduced due to the following change:
This unexpected side-effect is causing issues when we want to use the in-memory storage. In my case we ran it in a serverless environment that have limited access to the file-system.
The following exceptions is thrown:
Error: ENOENT: no such file or directory, mkdir '/var/task/localStorage'", " at Object.mkdirSync (fs.js:1013:3)", " at LocalStorage._init (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+node-localstorage@2.2.1/node_modules/node-localstorage/LocalStorage.js:183:14)", " at new LocalStorage (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+node-localstorage@2.2.1/node_modules/node-localstorage/LocalStorage.js:124:12)", " at new LocalStorageFactory (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:178:27)", " at new Config (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:274:89)", " at gateway (/var/task/dist/node_modules/.pnpm/registry.npmjs.org+@moltin+sdk@11.11.0/node_modules/@moltin/sdk/dist/moltin.cjs.js:3940:21)