Skip to content

Commit d8ceb08

Browse files
liyangworldvaga
authored andcommitted
fix: add warnings when the different namespaced modules has the same names… (vuejs#1554)
* add warnings when the different namespaced modules has the same namespace * Add warnings when duplicate namespace for different namespaced modules * Add warnings when duplicate namespace, merge if
1 parent 23211ee commit d8ceb08

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/store.js

+3
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ function installModule (store, rootState, path, module, hot) {
301301

302302
// register in namespace map
303303
if (module.namespaced) {
304+
if (store._modulesNamespaceMap[namespace] && process.env.NODE_ENV !== 'production') {
305+
console.error(`[vuex] duplicate namespace ${namespace} for the namespaced module ${path.join('/')}`)
306+
}
304307
store._modulesNamespaceMap[namespace] = module
305308
}
306309

0 commit comments

Comments
 (0)