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
TS compilation since Async feature #82
Comments
I have issues with the typing too. I wanted to test the library in a react + typescript environment and got this behavior: |
@Ricard I realize that RoughCanvasAsync and RoughSync do not have the same return type One option is that the return type is Drawable | Promise but that will add an extra check to the lib user. Let me think about it a bit. You could also start using the pre-built version of the library as well to get around it temporarily |
@dispix not sure what is happening in your case. I think it is picking up the wrong location of the lib/type defs. Maybe your tsconfig is not picking it up? |
Available in v2.2.5 |
@pshihn you can see the configuration in the sandbox, there's nothing special there and it works for other libraries so I have no idea where it comes from. I thought this was related to this issue but if you want I can create a new one. |
@dispix When I go to your url https://xoz411z0mq.codesandbox.io/ it loads fine and draws a box Also, the error you're getting is that My theory is that in the sandbox environment, either typings file is not being picked up, or when you import, it is importing the wrong type of module. There's a UMD version in the dist folder and there's the es6 module in the bin folder. |
It seems like codesandbox.io is not paying attention to the |
Alright.. A couple of things: import rough from 'roughjs'; But it doesn't work properly on codesandbox. Here's the working example based on your code that works on stackblitz: Hope this helps, @dispix |
Hello @pshihn, thank you for this great contribution 馃懐 馃憦
Since version 2.2.0, which introduce async methods, I'm not being able to build the library inside angular 6 app.
I do not provide OS and versions information because the issue reside on types of
RoughCanvasAsync
(promise of...) not matching the implemented classRoughCanvas
.Here you could see an evidence
The text was updated successfully, but these errors were encountered: