Skip to content

ExternalModule throws on hashing optional #5806

@STRML

Description

@STRML

Do you want to request a feature or report a bug?

Bug in 3.7.0

What is the current behavior?

Crash on

hash.update(JSON.stringify(this.optional));

TypeError: Data must be a string or a buffer

Reason is that this.optional is undefined, and JSON.stringify(undefined) does not produce "undefined" as you might expect, it produces undefined.

If the current behavior is a bug, please provide the steps to reproduce.

Include a basic external module. In my case, I had /^react(?:\/.*)?$/ in my externals and this was crashing on the request to react.

What is the expected behavior?
Don't crash.

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Webpack 3.7.0

PR incoming.

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