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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught ReferenceError: emotionReact is not defined at 9291 (userCodeAppPanel:2:53729)

iamsanteri opened this issue · comments

Hi, I've run into problems when using the command to bundle and deploy the app with: "npm run deploy". My application works fully well in the development environment with "npm run start", but when deploying and trying to run the editor add-on extension in non-development mode the sidebar remains on a white screen and console complains of emotionReact not being defined. Apps Script executions and logs show no errors whatsoever.

After trying to debug the issue for some time now and downgrading emotionReact package in package.json, as well as trying to get to the source of the issue I'm frankly just lost at where or when this error got introduced and why. I simply cannot find the point in time that introduced this error. The problem is also that I cannot see where or what is causing this as it seems to come from userCodeAppPanel which opens into a blank view in the console (see pictures below).

Any idea of how I could best start finding out what is going on or what to look for trying to debug this? It's really unsettling to me when my development (which works fine) and an eventual deploy into production diverges like this and I'm really quite lost here on how to get back to a working production deploy. Any ideas or helpers would be greatly appreciated as especially dealing with webpack or bundling is a dark place for me.

Screenshot 2024-04-12 at 11 26 23 Screenshot 2024-04-12 at 11 26 36

What makes this interesting is that all of other sample boilerplate apps included in this project still work fine with "npm run deploy", including the MUI dialog-based one, except for Bootstrap example which I haven't modified at all and where it also complains that ReactBootstrap is not found in a similar fashion to emotionReact in my main application based on this project's MUI sidebar:

Screenshot 2024-04-12 at 11 42 43

What could be the common strand with these which may have changed and broken the deploy workflow?

I've tried continue to look into the issue and when I open the deployed bundle in apps script and try to load emotionReact from unpkg I get a cloudflare error and seems their CDN could be down, is it possible that this is what causes the entire issue?

Seems like it's down: https://www.unpkg.com/status/

Also twitter feels to me like it is ablaze with this issue, so let's wait and see if they get back up and everything works again. Those CDNs...

Interesting -- haven't seen that before. You could try using a different CDN, or you could decide not to externalize all these packages in production, but it may slow down loading the app.

I confirm everything works now in production after the CDN is up again. Closing this issue.