Skip to content

TypeScript 4.7 source map file extension mismatchΒ #49335

Closed

Description

Bug Report

πŸ”Ž Search Terms

source map, extension

πŸ•— Version & Regression Information

TypeScript 4.7.2

⏯ Playground Link

Not a Playground link, but the repro is here: https://github.com/unional/tersify/tree/webpack

To repro it, run yarn bundle and open the demo.html in browser.

image

You can see that the source-map-loader able to get the unpartial/ts/index.ts file, but not the files it referenced (./required.js, ./unpartial.js).

This is because the files are actually in TS. i.e. required.ts and unpartial.ts.

I'm not sure if this is a TypeScript 4.7 bug or source-map-loader needs to be updated to support this.
But given it was working prior to TypeScript 4.7 and JS in general,
it is likely that the sourcemap generated by TypeScript 4.7 needs some adjustments.

πŸ’» Code

The referenced code unpartial is here: https://github.com/unional/unpartial
It is build with sourceMap: true in tsconfig.json

Since this is related to how the code is build and consumed, I don't have a minimal repro for this.
But the library I chose to demo this are simple enough that should be simple enough.

πŸ™ Actual behavior

Unable to consume the source map generated by TypeScript library using TS 4.7

πŸ™‚ Expected behavior

Should work, as shown in this branch: https://github.com/unional/tersify/tree/webpack-old

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ExternalRelates to another program, environment, or user action which we cannot control.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions