15.1.0 fails to build in TypeScript project (15.0.0 works)
See original GitHub issueHi,
when upgrading contentful/rich-text-html-renderer
and contentful/rich-text-types
from 15.0.0 to 15.1.0, we get the following error:
error TS7016: Could not find a declaration file for module '@contentful/rich-text-html-renderer'. '/[path redacted]/node_modules/@contentful/rich-text-html-renderer/dist/rich-text-html-renderer.es5.js' implicitly has an 'any' type.
A minimum sample can be found at https://github.com/somehan/2021-08-cf-lib-issue
Steps to reproduce using the sample project:
- Run
npm i
- Run `npm run build
Expected behavior:
- No output from
tsc
- Code gets built without errors
Acctual behavior:
tsc
reports one error:error TS7016: Could not find a declaration file for module '@contentful/rich-text-html-renderer'. '/home/[path redacted]/cf-lib-issue/node_modules/@contentful/rich-text-html-renderer/dist/rich-text-html-renderer.es5.js' implicitly has an 'any' type. Try
npm i --save-dev @types/contentful__rich-text-html-rendererif it exists or add a new declaration (.d.ts) file containing
declare module ‘@contentful/rich-text-html-renderer’;``
When downgrading the libraries to 15.0.0, compilation works as expected.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How do I resolve peer dependency error: The package react ...
it worked when i updated npm "npm install npm -g" and then downgraded react to; "react": "15.3.0" , cleared cache: npm cache clear...
Read more >[Node.js 12.11+ and Windows 10] Error: Cannot find module ...
My use case: I have TypeScript projects that are coded as ES modules (for example: cedx/coveralls.js or cedx/which.js).
Read more >Prevent npm install for not supported Node.js versions
When I run npm install in a project with a not supported Node.js version, the following warning ( EBADENGINE ) is displayed. $...
Read more >Deprecations by version - GitLab Docs
In GitLab 16.0, any personal, project, or group access token that does not have an expiration date will automatically have an expiration date...
Read more >How to set up TypeScript
Add TypeScript to your project, or install TypeScript globally. ... many different versions of TypeScript, this keeps each project working consistently.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also hit this. The cause is that the
typings
inpackage.json
point todist/types/index.d.ts
, however this file does not exist in the package: onlydist/types/rich-text-html-renderer/src/index.d.ts
(and strangelydist/types/rich-text-react-renderer/src/index.d.ts
- not sure why React typings are being published in the non-React package).As a hacktacular workaround liable to break once this gets fixed, you can do this instead:
Just for reference: the new version also works in our production app. Thanks for the fix, @kamsar and @djagya !