-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
TypeError: html2canvas.default is not a function #1440
Comments
Can confirm this is because the update to angular cli 1.6.8 Downgrading back to 1.5.0 seems to be a work around for this issue. |
Happens for me too! I am on angular/cli: 1.7.3 |
Happens for me too! I am on angular/cli: 1.7.2 |
@niklasvh Help me Thank you very much |
So how do i go about this erro? I should downgrade my version of angular cli? |
Make sure to import the script under the scripts list in angular-cli.json And in the class as: import * as html2canvas from "html2canvas" |
Thanks @dbonillao |
Thanks @dbonillao ! |
Really awesome @dbonillao thank you so much....... |
for me works, in my file
|
|
how to fix it ? |
Remove "default" word |
I was able to resolve the 'not a function' error that is throw when trying to call
If you change the last line to: and import the module like this: it no longer throws an error. Hope this helps someone. |
Got the same issue, @dharnen solution helped.
It did the trick for me. |
thank you @uttahb. |
But this is wrong, you can not modify the library because at the time of making npm install or update is overwritten the change made or not? or where do you make the change? |
Hello @briancaldass, Modifying the downloaded packages is definitely not a preferred solution because of the risk that if the packages get re downloaded the changes made do not persist, which you touched on. That being said once downloaded they are not overwritten, even if you run npm install, as long as your |
For me the problem was I'm using TypeScript and the I had to use any to get around this as follows:
|
This worked for me, thanks! |
Bug reports:
Simple Call:
Is giving me:
ERROR TypeError: html2canvas_1.default is not a function
This happened after upgrading Angular cli@1.6.8 from 1.5.0. I assume it might be because there was a TypeScript Update?
The text was updated successfully, but these errors were encountered: