Skip to content

Cannot detect sourceMappingURL if there is a trailing newline #45982

@JoelEinbinder

Description

@JoelEinbinder

After I upgraded my TypeScript I noticed my sourcemaps broke. I bisected down to #44197, which
seem to subtly change the regex matching the sourceMappingURL so that it will not match
if the line ends with '\n'.

I generate my d.ts myself and they have a trailing newline.

export function foo(): number;
//# sourceMappingURL=/path/to/my/file.d.ts.map
<-- this line is blank

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions