I’ve got the same problem - exporting svg and getting the error "Cannot find name ‘TextDecoder’, and then adding ‘dom’ to ‘lib’ in tsconfig and then getting two conflict errors in @figma plugin-typings: console and fetch.
However, I had a look at this solution - the latest from 2022 is to include "moduleDetection": "force"
in tsconfig.json compilerOptions.
Unfortunately this still doesn’t work as I now have:
figma_app.min.js.br:5 Syntax error on line 34: Unexpected token export {};
It seems that the earlier workaround to add “export {}” manually has been replaced with a flag that adds it for you. Either way manually or otherwise, it still doesn’t work.