Skip to content

[email protected] 'strict' mode and 'store.module' mutation error #243

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

Closed
karol-f opened this issue Jul 8, 2016 · 4 comments
Closed

[email protected] 'strict' mode and 'store.module' mutation error #243

karol-f opened this issue Jul 8, 2016 · 4 comments
Assignees

Comments

@karol-f
Copy link

karol-f commented Jul 8, 2016

Hi, using [email protected] and 'strict' mode, after adding new store module using store.module(...) I got warning:

Uncaught Error: [vuex] Do not mutate vuex store state outside mutation handlers.

Code: http://www.webpackbin.com/VJ91GduIZ

What should happen
Adding store module should not raise error in strict mode.

Regards!

@karol-f karol-f changed the title [email protected] 'strict' mode and 'store.module' mutation warning [email protected] 'strict' mode and 'store.module' mutation error Jul 8, 2016
@blake-newman blake-newman added the bug Something isn't working label Jul 8, 2016
@blake-newman blake-newman self-assigned this Jul 8, 2016
@blake-newman blake-newman removed the bug Something isn't working label Jul 8, 2016
@blake-newman
Copy link
Member

This is working as expected currently. For 3rd party modules, we recommend you create an optional vuex modules that users can import. Therefore allowing multiple workflow paths to use your 3rd party library.

@evan would you agree?

@karol-f
Copy link
Author

karol-f commented Jul 8, 2016

@blake-newman I'm not sure if I understand.

  • I am using "Nested Modules Improvements" described here
  • this are in-library/in-app modules, used for decoupling store
  • different components may be lazy loaded when needed and I don't want to initiate 'store' with it's state beforehand
  • I think it's really nice idea to structure app/library in such way that all components are self sustaining - you can just copy/paste component with all things included (like store/state initialization)

Regards.

@LinusBorg
Copy link
Member

@blake-newman I think you meant to mention @yyx990803 instead of the github user "evan" ;)

@ghost
Copy link

ghost commented Sep 15, 2016

thanks for that issue. that is solution of my cause on 1.0.0.rc-2. i will update to latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants