Skip to content

Bug: Cannot use 'ng-cache' loader without params #38

@osrecki

Description

@osrecki

Affected versions
webpack: 3.10.0
ng-cache-loader: >= 0.0.24

Webpack config

{
    test: /\.html$/,
    loader: 'ng-cache',
    ...
}

Error

Module build failed: TypeError: Cannot read property 'prefix' of null

Workaround
Append ? to loader:

    loader: 'ng-cache?'

loader-utils#getOptions returns null on empty this.query. Prior to version 0.0.24, loader-utils#parseQuery was used, which returned {} on empty this.query.

Workaround is simple, but I still consider it a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions