Skip to content

Typescript error: The '@codedread/bitjs' library may need to update its package.json or typings #49

Open

Description

@kilterskjalg

Hi.

I get this error:
Typescript error: There are types at 'node_modules/@codedread/bitjs/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@codedread/bitjs' library may need to update its package.json or typings

The error goes away if I find package.json in node_modules/@coderead and replace:

"exports": "./index.js"

with

"exports": [
    "./index.js",
    "./types/index.d.ts" 
  ],

Activity

  1. codedread commented on Feb 26, 2024

    @codedread
    Owner

    I have not done a serious amount of research on this yet, but can you clarify if your project is using CJS or ESM-type modules? It would be helpful to provide a link to a minimal project where this does not work properly (package.json, tsconfig.json and one file that tries to use @codedread/bitjs

  2. codedread commented on Feb 26, 2024

    @codedread
    Owner

    Here's a possible way to fix: thomasbrodusch/vitest-fail-on-console#10

  3. codedread commented on Apr 1, 2024

    @codedread
    Owner

    @kilterskjalg - can you please read the above comment and answer the question there?

  4. pinned this issue on Apr 1, 2024
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions