question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to read the 'localStorage'

See original GitHub issue

Describe the bug Everything works just fine in development mode but I’m getting this error in the devtools console after building my app: Uncaught DOMException: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document. at app://./js/chunk-vendors.0b3afa94.js:175:17895 at Object.b25c (app://./js/chunk-vendors.0b3afa94.js:175:18055) at l (app://./js/app.a7acfa50.js:1:618) at Module.56d7 (app://./js/app.a7acfa50.js:1:7568) at l (app://./js/app.a7acfa50.js:1:618) at Object.0 (app://./js/app.a7acfa50.js:1:3170) at l (app://./js/app.a7acfa50.js:1:618) at n (app://./js/app.a7acfa50.js:1:388) at app://./js/app.a7acfa50.js:1:3135 at app://./js/app.a7acfa50.js:1:3140

To Reproduce npm run electron:build and then open the the app

Expected behavior Get access to LocalStorage

Environment (please complete the following information):

  • OS and version: Linux Ubuntu Studio 18.10
  • node version: 12.1.0
  • npm version: 6.9
  • yarn version (if used): 1.10.1
  • vue-cli-plugin-electron-builder version : 1.3.1
  • electron version: 5.0.0
  • other vue plugins used: vue-router, vuex, vuex-persistedstate, heap/electron-cookies (is not a vue plugin but could relate with the issue), vuetify, cli-babel and eslint. Theres also electron-rebuild (the only way I could find to correctly complite the native dependency “serialport”)
  • custom config for vcp-electron-builder:
module.exports = {
  pluginOptions: {
    electronBuilder: {
      // List native deps here if they don't work
      externals: ['serialport', 'osc'],
      nodeModulesPath: ['./node_modules']
    }
  }
}

Additional context This only started after I changed to electron 5.0.0 and node 12.0.0. Later, to correct another problem, namely an “error 138” while trying to build the app I updated it to 12.1.0.

Thank you for this project. Since now I’m having a solid experience with it.

best regards, Gil

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
crosslecommented, May 7, 2019

background.js use standard: true,

protocol.registerSchemesAsPrivileged([
  { scheme: 'app', privileges: { standard: true, supportFetchAPI: true, secure: true } }
])

0reactions
milahucommented, Sep 4, 2021

registerSchemesAsPrivileged was no help … in my case, i had to run electron-builder

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to read the 'localStorage' property from 'Window'
Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. ... This exception is thrown when the...
Read more >
Iframe in Chrome error: Failed to read 'localStorage' from ...
This exception is thrown when the "Block third-party cookies and site data" checkbox is set in Content Settings. To find the setting, open...
Read more >
How to fix "SecurityError: Failed to read the 'localStorage ...
How to fix "SecurityError: Failed to read the 'localStorage' property from 'Window'" · 1. In the Google Chrome browser, at the top right,...
Read more >
[Uncatchable Error] Failed to read the 'localStorage' property ...
Reproduced on Chrome, Safari, Opera, Firefox. The reason is, has told by the error, access to window.localStorage is forbidden when user block ...
Read more >
Failed to read the 'localStorage' property from 'Window'
Failed to read the 'localStorage ' property from 'Window': Access is denied for this document. I have implemented Chat in my Web site...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found