Skip to content

Error when upgrading ts-loader #1638

Closed
@michaeltford

Description

@michaeltford

I now get a null pointer exception

mappings: inputSourceMap.mappings,

This is because my prod build is not generating source maps and somehow the inputSourceMap is null (I am not setting it). The following code checks for undefined but not null.

If I change the following

https://github.com/TypeStrong/ts-loader/blob/9315855cd6f87883b137fc762da02f99a7842f46/src/index.ts#L152C3-L152C3

if (sourceMap === undefined || inputSourceMap === undefined) { callback(null, output, sourceMap); return; }
to
if (!sourceMap || !inputSourceMap) { callback(null, output, sourceMap); return; }
everything works as expected.

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