Skip to content

[Bug]: Types error after "types": "./dist/index.d.ts" removal from package.json #1545

@tomek-f

Description

@tomek-f

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

After 4.1.2 update:

  • NPM does not show blue types icon (This package contains built-in TypeScript declarations)
  • Typescript whines about types TS2307: Cannot find module 'browserslist-useragent-regexp' or its corresponding type declarations. There are types at '/Users/xyz/Workspace/abc/node_modules/browserslist-useragent-regexp/dist/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

Changing moduleResolution from node to 'node16', 'nodenext', or 'bundler', opens another can of worms in my project.

I believe it's this change: f014612#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L33

Was this change intentional?

4.1.1 https://www.npmjs.com/package/browserslist-useragent-regexp/v/4.1.1?activeTab=code
4.1.2 https://www.npmjs.com/package/browserslist-useragent-regexp/v/4.1.2?activeTab=code

Reproduction

N/A

browserslist-useragent-regexp version

v4.1.2

Possible solution

  • bring back "types": "./dist/index.d.ts" part

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions