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

No .d.ts declaration file found for extensions #73

Open
bostrom opened this issue Nov 30, 2022 · 3 comments
Open

No .d.ts declaration file found for extensions #73

bostrom opened this issue Nov 30, 2022 · 3 comments

Comments

@bostrom
Copy link

bostrom commented Nov 30, 2022

Hello, I get the following error when trying to use components from the extensions subpackage.

import { MjmlHtml } from '@faire/mjml-react/extensions';

results in

Could not find a declaration file for module '@faire/mjml-react/extensions'. 
'node_modules/@faire/mjml-react/extensions.js' implicitly has an 'any' type.
If the '@faire/mjml-react' package actually exposes this module, 
try adding a new declaration (.d.ts) file containing 
`declare module '@faire/mjml-react/extensions';`

Adding the said declaration file resolves the issue, but this should probably be fixed here instead.

@emmclaughlin
Copy link
Collaborator

Thanks for pointing this out @bostrom. I believe I see the issue. The declaration file for @faire/mjml-react/extensions can't be found based on what is defined in the package.json for types field. We would just need to update the build to include a package.json to point to the correct declaration file. I believe #72 is caused by the same root problem. Glad you have a work around, but this is definitely on the radar to be fixed.

@IanEdington
Copy link
Contributor

@bostrom (or anyone reading) we'd be very happy to accept a PR for a fix!

I think the best solution is to fix #71 and #72. Then doing ... from '@faire/mjml-react/extensions' is directly accessing the index(.js|.d.ts) inside /extensions

@emmclaughlin
Copy link
Collaborator

This is fixed by #77 for commonJS. #72 will fix for esm as well, but is still outstanding at this time.

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

3 participants