Skip to content

Commit

Permalink
fix(core): only warn for duplicate module if metaKey is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed Jun 25, 2020
1 parent b027435 commit b070e19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ export default class ModuleContainer {
}

// Ensure module is required once
const key = (handler.meta && handler.meta.name) || src
const metaKey = handler.meta && handler.meta.name
const key = metaKey || src
if (typeof key === 'string') {
if (this.requiredModules[key]) {
if (key === src) {
if (!metaKey) {
// TODO: Skip with nuxt3
consola.warn('Modules should be only specified once:', key)
} else {
Expand Down

0 comments on commit b070e19

Please sign in to comment.