Skip to content

Conversation

@pengx17
Copy link

@pengx17 pengx17 commented Sep 18, 2023

it reports the following error on one of my repo

Could not find a declaration file for module 'tinykeys'. '.../node_modules/tinykeys/dist/tinykeys.module.js' implicitly has an 'any' type.
  There are types at '.../node_modules/tinykeys/dist/tinykeys.d.ts', but this result could not be resolved when respecting package.json "exports". The 'tinykeys' library may need to update its package.json or typings.

The PR fixes the above issue.

it reports the following error on one of my repo

```
Could not find a declaration file for module 'tinykeys'. '.../node_modules/tinykeys/dist/tinykeys.module.js' implicitly has an 'any' type.
  There are types at '.../node_modules/tinykeys/dist/tinykeys.d.ts', but this result could not be resolved when respecting package.json "exports". The 'tinykeys' library may need to update its package.json or typings.
```

The PR fixes the above issue.
@pengx17 pengx17 changed the title fix: export types fix: exports types field Sep 18, 2023
@slavik-chapelskyi
Copy link

Happens to me as well with tsconfig moduleResolution: node16
@jamiebuilds Any chance this could be merged soon?

@hellovietduc
Copy link

Can we merge this please? @jamiebuilds

@Rafler
Copy link

Rafler commented Jul 26, 2024

@jamiebuilds It would really help to add type: 'module' too. Based on the Node docs:
https://nodejs.org/api/packages.html#type

If the nearest parent package.json lacks a "type" field, or contains "type": "commonjs", .js files are treated as CommonJS. If the volume root is reached and no package.json is found, .js files are treated as CommonJS.

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

Successfully merging this pull request may close these issues.

4 participants