Skip to content

Hard-to-locate error when providing wrong parameter type to mapState #1162

Closed
@joachimboggild

Description

@joachimboggild

Version

3.0.1

Reproduction link

https://codesandbox.io/s/048lw4q59n

Steps to reproduce

  1. Open code sandbox provided.
  2. Look inside console to the error message provided.

To fix the problem, include brackets inside the mapState statement on line 97 in the HelloWorld.vue file.

What is expected?

It was expected that an error message would state that the parameter for the mapState function was invalid in 'HelloWorld.vue'.

What is actually happening?

This error message is returned:

[Vue warn]: Failed to resolve async component: function HelloWorld() {
  return _promise2.default.resolve().then(function () {
    return require("./components/HelloWorld");
  });
}
Reason: TypeError: Cannot convert undefined or null to object

I just thought that this was a difficult error to track, because the error message provided did not point towards the actual error. If it is possible to make the error message more precise, it would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions