New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: a.localStorage.setItem is not a function #17109
Comments
Hi @landall! 👋 It looks like you provided an invalid or unsupported reproduction URL. Without a proper reproduction, your issue will have to get closed. Thank you for your collaboration. 👏 |
http://74.48.64.200/spa1001/#/ |
And which build command can build just the same behavior with |
It is an issue about useQuasar() in anonymous function in src/router/index.js.
|
Not only index.js, all $q.localStorage report TypeError. |
please ref: https://quasar.dev/quasar-plugins/web-storage import { LocalStorage, SessionStorage } from 'quasar'
LocalStorage.set(key, value)
let value = LocalStorage.getItem(key)
SessionStorage.set(key, value)
let value = SessionStorage.getItem(key) |
sorry, a careless mistake. |
It confuses me that the methods are getItem & set in Quasar.LocalStorage but getItem&setItem in Html5. Maybe add a setItem method to be the alias of set is a good choice. |
…tem" aliases (matches web storage specs) #17109
@landall Good point. Added aliases. Will be available in Quasar v2.15.3 |
What happened?
My site works ok with quasar dev run but white screen with quasar build.
DevTools console show:
TypeError: a.localStorage.setItem is not a function
at app.ccb5cce6.js:1:1607
at vendor.0daabce7.js:69:13691
at o (vendor.0daabce7.js:69:13423)
at vendor.0daabce7.js:69:13682
at new Promise ()
at vendor.0daabce7.js:69:13496
at Object.runWithContext (vendor.0daabce7.js:3:8038)
at N (vendor.0daabce7.js:69:19818)
at vendor.0daabce7.js:69:22842
What did you expect to happen?
works the same with quasar dev run.
Reproduction URL
http://74.48.64.200/spa1000/#/
How to reproduce?
It seems to be a build issue.
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
Plugins (quasar), SPA Mode
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: