P
P
pegas2019-01-06 20:22:36
webpack
pegas, 2019-01-06 20:22:36

Why is webpack building throwing an error?

I export the store module (plugin for Vue) to the input file for webpack, I run npm run dev , and I get an error in the console Error in created hook: "TypeError: Cannot read property 'dispatch' of undefined". There are no errors in the code. If you directly insert the code from the module, then everything works.

Help please, I made a visual turnip:
github.com/Artem-PeGaS/test-webpack.git
Apparently, the webpack assembly is wrong, but I don’t understand what the problem is

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-06
@1PeGaS

In main.js:
In store.js:
You would decide which vue assembly you want to use. And now you connect vuex to one, but you really use another. Naturally, $store turns out to be undefined.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question