Skip to content
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

Missing plugin error on migrating from 5.0 provides no useful information #1841

Closed
kpdecker opened this issue Aug 6, 2014 · 6 comments
Closed
Assignees
Milestone

Comments

@kpdecker
Copy link
Contributor

@kpdecker kpdecker commented Aug 6, 2014

./node_modules/hapi/node_modules/hoek/lib/index.js:425
    throw new Error(msgs.join(' ') || 'Unknown error');
          ^
Error: Missing plugin name 
    at Object.exports.assert (./node_modules/hapi/node_modules/hoek/lib/index.js:425:11)
    at internals.Pack._register (./node_modules/hapi/lib/pack.js:245:14)
    at internals.Pack.register (./node_modules/hapi/lib/pack.js:179:17)
    at ./node_modules/hapi/lib/pack.js:812:18
    at iterate (./node_modules/hapi/node_modules/async/lib/async.js:149:13)
    at Object.async.eachSeries (./node_modules/hapi/node_modules/async/lib/async.js:165:9)
    at ./node_modules/hapi/lib/pack.js:809:15
    at iterate (./node_modules/hapi/node_modules/async/lib/async.js:149:13)
    at Object.async.eachSeries (./node_modules/hapi/node_modules/async/lib/async.js:165:9)
    at Function.internals.Pack.compose (./node_modules/hapi/lib/pack.js:759:11)

Doesn't provide in indication on what may have gone wrong, vs. the schema validated errors seen in the past.

{
    "pack": {
    },
    "servers": [
        {
            "port": 8888,
            "options": {
                "labels": ["api", "http"]
            }
        }
    ],
    "plugins": {
        "furball": {
            "version": "/foo",
            "plugins": "/bar"
        }
    }
}
@kpdecker
Copy link
Contributor Author

@kpdecker kpdecker commented Aug 6, 2014

This particular error seems to be related to the furball module itself not being updated for 6.0. Since the name is available through the composer require mechanisms it would be nice to have a better message here saying something along the lines of "The plugin furball is invalid" or something else that is a bit more detailed than "Something is missing a name".

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Aug 7, 2014

The problem is that this error comes from a level that has no idea of the require action. It would be really messy to add that. This should be a limited time issue of migrating to 6.0.

@hueniverse hueniverse closed this Aug 7, 2014
@hueniverse hueniverse added the bug label Aug 7, 2014
@hueniverse hueniverse self-assigned this Aug 7, 2014
@kpdecker
Copy link
Contributor Author

@kpdecker kpdecker commented Aug 7, 2014

Doing something like this helped immensely, with relatively few gymnastics:

        Async.forEachSeries(plugins, function (plugin, nextRegister) {

            try {
                pack.register(plugin.module, plugin.apply, Hoek.nextTick(nextRegister), state);
            } catch (err) {
                throw new Error('Failed to load plugin "' + path + '": ' + err.message);
            }
        }, nextName);

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Aug 7, 2014

I'll take a PR.

@hueniverse hueniverse reopened this Aug 7, 2014
@blissdev
Copy link

@blissdev blissdev commented Aug 12, 2014

I'm running into this issue as well. What is the correct way to fix this? It seems to be coming from requiring a plugin that has a peerDep of Hapi, but should be the up to date version. Perhaps the plugin needs to be updated, but I'm not sure what to change.

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Aug 12, 2014

@blissdev make sure all the plugins you are using support 6.0

@hueniverse hueniverse closed this Aug 13, 2014
@hueniverse hueniverse added this to the 6.0.0 milestone Aug 13, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants