Comments (5)
Really sorry about this, I forgot the SPA mode 🤦
I just releases v1.0.3 to fix this regression.
from color-mode.
ctx.nuxtState.colorMode
is undefined
on my dev environment (macOS 10.15.6, nuxt 2.14.0, SPA mode)
This commit caused the bug and changing themes is not working in 1.0.2.
Revert this part fixed everything for me. 7a873ab#diff-58e6cb97fd6582c2fdc3e79032ce4070L13-L1
Update 1:
Cause: nuxtState
is available only in universal mode, which makes ctx.nuxtState.colorMode
undefined in SPA mode.
from color-mode.
Ok so I updated to Nuxtjs 2.14.0 and color 1.0.2
I still have the warning and
yarn build + yarn start as an SPA still throws the same error on start up:
TypeError: Cannot read property 'preference' of undefined
at be (app.250609e.js:1)
at app.250609e.js:1
at h (vendors~app.761da66.js:2)
at Generator._invoke (vendors~app.761da66.js:2)
at Generator.next (vendors~app.761da66.js:2)
at r (app.a5226ce.js:2)
at l (app.a5226ce.js:2)
FIY 1.0.0 doesn't throw the "[Vue warn]: data functions should return an object:
https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function
(found in )" warning but still throws the "Cannot read property 'preference' of undefined" when building.
Any clue what could be happening since everything is a-OK when yarn dev and I didn't have any issue beforehand?
from color-mode.
@rankjie I applied your patch and I am able to select Theme on 1.02, thanks!
However, when building (yarn build) and starting (yarn start), I still have my app crashing with the
Cannot read property 'preference' of undefined
error.
Do you see the same issue? Any idea on how to fix that?
from color-mode.
@Atinux, i have the same problem. please check my issue - #25
from color-mode.
Related Issues (20)
- Limit allowed color modes to a set of values (whitelist)
- Not working with daisyUI
- Adjust system elements (e.g. scrollbar) along with the switch HOT 1
- Local storage is blocked in iframes using cross domains sources. HOT 1
- [BUG] Flashbang 💥 FOUC 🫣
- Not change body class
- More color modes
- SSR - Hydration text mismatch HOT 2
- Throws Error about accessing `preference` of `undefined` HOT 4
- Dark theme cannot be loaded
- allow disabling css transitions while changing color scheme
- Get color-theme while server render
- Forced color mode incorrect timing
- Adding class "theme-red" to <html> breaks color-mode
- Load color-mode already in spa template
- helper.getColorScheme is not a function error when trying to use the module HOT 6
- Can I use only data value?
- Selected Color dosn't save on LocalStorage
- Question about demo asset regarding license HOT 2
- On light mode background-color is transparent HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from color-mode.