Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated types have broken references #145

Open
adidahiya opened this issue Jan 29, 2024 · 0 comments
Open

Generated types have broken references #145

adidahiya opened this issue Jan 29, 2024 · 0 comments

Comments

@adidahiya
Copy link

It seems like the types (presumably generated by rollup) in @table-library/react-table-library/table/Table/index.d.ts have broken references to modules within this monorepo:

declare const Table: React.ForwardRefExoticComponent<Pick<{
    data: import("@table-library/react-table-library/types/table").Data<TableNode>;
    theme?: Theme | undefined;
    layout?: Layout | undefined;
    sort?: import("../../types").Sort<TableNode> | undefined;
    pagination?: import("../../types").Pagination<TableNode> | undefined;
    select?: import("../../types").Select<TableNode> | undefined;
    tree?: import("../../types").Tree<TableNode> | undefined;
    onInit?: import("@table-library/react-table-library/types/table").OnInitFunction | undefined;
    children?: ((nodes: import("@table-library/react-table-library/types/table").ExtendedNode<TableNode>[]) => React.ReactNode) | undefined;
} & import("@table-library/react-table-library/types/table").RestProps, string> & React.RefAttributes<unknown>>;

unpkg link

The import("../../types") expressions should probably be emitted as import("@table-library/react-table-library/types") instead.

This causes issues with downstream TS compilation:

../../node_modules/@table-library/react-table-library/table/Table/index.d.ts:12:19 - error TS7016: Could not find a declaration file for module '../../types'. '/Users/adi/Developer/repos/personal/raga/node_modules/@table-library/react-table-library/types.js' implicitly has an 'any' type.

12     tree?: import("../../types").Tree<TableNode> | undefined;
                     ~~~~~~~~~~~~~


Found 4 errors in the same file, starting at: ../../node_modules/@table-library/react-table-library/table/Table/index.d.ts:9

Environment:

  • Yarn v4 with nodeLinker: node-modules
  • Node.js v20.11.0
  • TypeScript v5.3.3

I can work around these by setting skipLibCheck: true, but this is a band-aid fix which may cause other legitimate compiler errors to be swallowed, and I do not wish to use that as a long-term solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant