figma-html icon indicating copy to clipboard operation
figma-html copied to clipboard

Uncaught TypeError: html_to_figma_1.htmlToFigma is not a function

Open studiotimo opened this issue 3 years ago • 2 comments

Hello,

I was trying to run chrome extension and I'm stuck because when I tried to run it with npm run watch command, it threw this error as soon as I clicked on the "Capture Current Page" button:

Uncaught TypeError: html_to_figma_1.htmlToFigma is not a function

Screen Shot 2021-08-11 at 2 07 55 PM

Do you have any idea what I can do now? Please advise.

Thank you.

studiotimo avatar Aug 11 '21 21:08 studiotimo

hey @studiotimo - that's odd, I just did the following and it worked as expected, are these any different than your steps?

cd chrome-extension
npm install
npm run watch

then I went to chrome://extensions and chose "load unpacked" and then chose chrome-extension/dist folder

then I went to disney.com and found the HTML <> Figma extension and chose "Capture current page" and it downloaded as expected

steve8708 avatar Aug 18 '21 15:08 steve8708

Thanks, @steve8708 . I tried it again from scratch, but this time, for some reason, I'm having trouble in npm install. I got a lot of errors related to libsass. (Please see the attached screenshot.) This stackoverflow thread shows the same kind of error message in console. I guess this has something to do with Node.js version, node-sass version, and etc. Could you share the version number of Node.js and node-sass in your computer? (My Node.js version was v14.17.4 (and I tried upgrading to v16.7.0) and it didn't work either way.)

On the other hand, I found a workaround by bundling inject.ts only, instead of using npm run watch command. So I'm able to run the chrome extension locally. Since the issue is not a blocker for me, you may close this issue if you want. If you can add your version number of Node.js and node-sass, though, before closing this, it could be helpful for me and others. Thank you!

Screen Shot 2021-08-18 at 10 32 43 AM

studiotimo avatar Aug 18 '21 17:08 studiotimo