Skip to content

Source mappings are missing for serialized properties #60004

Open
@Andarist

Description

@Andarist

πŸ”Ž Search Terms

source map declaration map properties symbols navigation definition goto

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

N/A

πŸ’» Code

// api.ts
type ValidateShape<T> = {
  [K in keyof T]: T[K];
};

function test<T>(arg: ValidateShape<T>) {
  function createCaller<T>(arg: T): () => {
    [K in keyof T]: () => T[K];
  } {
    return null as any;
  }
  return {
    createCaller: createCaller(arg),
  };
}

const api = test({
  foo/*target*/: 1,
  bar: "",
});

export const createCaller = api.createCaller;

// main.ts

import { createCaller } from "./api";
const caller = createCaller();
caller.foo/*source*/;

πŸ™ Actual behavior

Please consider the 2 files above as 2 separate projects.

When those files are in the same project we can successfully go from the source marker to the target marker with "go to definition" and others like it. The same works with project references on.

However, when api.ts gets compiled with declaration maps and consumed through that then this navigation no longer works correctly.

πŸ™‚ Expected behavior

I'd expect this navigation to continue to work

Additional information about the issue

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @RyanCavanaugh@Andarist

      Issue actions

        Source mappings are missing for serialized properties Β· Issue #60004 Β· microsoft/TypeScript