Skip to content

Undefined partial names cause TypeError to be thrown #2254

@rpkilby

Description

@rpkilby

We have a bug in our code that results in an undefined partial name for a split second. This causes a TypeError to be thrown before assertAsset can display a meaningful warning. fiddle

The problem is that resolveAsset assumes that the asset id will be a string, even though this is not necessarily the case when the id is dynamically bound. A few possible solutions:

  • Force the asset id to a string before camelization
  • Only perform camelCase and PascalCase lookups if isString(id)
  • Assert that the asset id is a string, although all calling code would now have to handle that case. Partial/component/other asset registration would probably need to do the same as the following is technically legal: Vue.partial({}, '<div>lolol</div>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions