Hi Figma,
I’m following the instructions to set up Webpack for a Figma plugin I’m working on as per these https://www.figma.com/plugin-docs/bundling-webpack/
instructions.
However, after setting everything up, I’m running into the following errors while building the plugin
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
3:0-8
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(3,1)
TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
4:18-26
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(4,19)
TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
4:54-70
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(4,55)
TS2304: Cannot find name 'HTMLInputElement'.
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
6:2-8
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(6,3)
TS2552: Cannot find name 'parent'. Did you mean 'parseInt'?
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
9:0-8
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(9,1)
TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts
10:2-8
[tsl] ERROR in /Users/aashreys/Workspace/figma/figma-controller-prototyper/src/ui.ts(10,3)
TS2552: Cannot find name 'parent'. Did you mean 'parseInt'?
6 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.52.1 compiled with 6 errors in 220 ms
After searching the internet it seems like the solution to the problem is to compile TS against the ES6 standard. But being very new to web dev, I’m not sure what this means or how I should go about doing it.
Can someone help? TIA 🙂