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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
rough.js and Typescript #145
Comments
The types field is set in the package.json file. Can you share a sample project setup where you are experiencing this? Thanks |
Here is a sample project setup: https://github.com/puigfp/roughjs-types-issue I created it using I can see the |
Perhaps. It may depend on the tsconfig set up for you by create-react-app. You may be right as it depends on how you import it. Is I will try your sample repository later today. |
When using
|
Argh it always comes down to Webpack! haha |
Thanks ! |
I looked at your project, and this should work: import rough from "roughjs/bin/rough"; |
Yes indeed it works. Thank you. |
Would love to see this in the docs! |
* React 16 -> React 18 (upgrade typing, switch to new root API) * Cypress upgraded to 8.x (will do upgrades with major breaking changes later) * Modify roughjs imports - rough-stuff/rough#145 (comment)
Hi!
First of all, thanks for creating this package 馃槃
I had some trouble getting rough.js to work on a create-react-app / Typescript setup.
When importing rough.js using
import rough from "roughjs/bundled/rough.esm.js"
, I got this error:I'm a beginner with TypeScript, so I'm not sure what would be the best solution to fix that, but it seems that adding the following file solves the issue.
roughjs/bundled/rough.esm.d.ts
I'm assuming similar files could be created for the other bundles as well.
Would you be open to a PR for this change ? or do you think there is a better way of solving the issue?
The text was updated successfully, but these errors were encountered: