enuchi / React-Google-Apps-Script

This is your boilerplate project for developing React apps inside Google Sheets, Docs, Forms and Slides projects. It's perfect for personal projects and for publishing complex add-ons in the Google Workspace Marketplace.
MIT License
1.32k stars 171 forks source link

ReferenceError: TextEncoder is not defined : how to diagnose a solution #217

Closed jmatthewpryor closed 4 months ago

jmatthewpryor commented 4 months ago

Hi

I am trying to have server side code that uses EmailBuilder.js to generate email. I am also using LiquidJS templating to assist in that.

I added those modules to my project, which builds and deploys, but generates this error in onLoad()

ReferenceError: TextEncoder is not defined at 911(code:7813:22) at __webpack_require__(code:9490:45) at 848(code:9213:47) at __webpack_require__(code:9490:45) at 702(code:67:86) at __webpack_require__(code:9490:45) at [unknown function](code:9517:20) at [unknown function](code:9531:7) at [unknown function](code:9536:3)REFRESH I would appreciate some tips for how to track down the source and resolve the issue

enuchi commented 4 months ago

Hmm this looks like a client side library. You can't install packages on the server side of things since it's not running a Node environment (except maybe packages that don't have any dependencies).

jmatthewpryor commented 4 months ago

thanks @enuchi - I am pretty much fumbling in the dark here - any further pointers you can give me would be great (or alternative approaches)

jmatthewpryor commented 4 months ago

I've worked around it - pushed needed functions to an API