BuilderIO / figma-html

Builder.io for Figma: AI generation, export to code, import from web
https://www.figma.com/community/plugin/747985167520967365
MIT License
3.11k stars 287 forks source link

Uncaught TypeError: html_to_figma_1.htmlToFigma is not a function #75

Open studiotimo opened 3 years ago

studiotimo commented 3 years ago

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.

steve8708 commented 3 years ago

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

studiotimo commented 3 years ago

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