userbase icon indicating copy to clipboard operation
userbase copied to clipboard

blob-polyfill => fetch-blob and use /tmp for LocalStorage

Open jq170727 opened this issue 2 years ago • 0 comments

This request proposes to fix two small problems in userbase-js-node:

  • "blob-polyfill" no longer works, generating instead the following error:

    % node index.js 
      xxx/node_modules/blob-polyfill/Blob.js:519
                                "-ms-scroll-limit" in document.documentElement.style &&
                                                      ^
      ReferenceError: document is not defined
    
  • On Vercel the current directory isn't writable by server-less functions.

To address these issues it:

  • replaces "blob-polyfill" with the newer "fetch-blob"
  • moves the parent of LocalStorage to "/tmp"

These changes work for my userbase use-case but would appreciate feedback and/or suggestions as to alternative solutions.

jq170727 avatar Feb 28 '23 23:02 jq170727