React-Google-Apps-Script: serverFunctions[functionName] is not a function after upgrading project to match most recent repo update
After matching up deps, files, webpack, etc. I’ve almost got my add-on up and running again but I’m getting a weird error relating to my server functions when I run with npm start
.
I’m not really sure why it’s happening… I can see my code.gs
has all the ui.js
and sheets.js
functions in it as I’ve exported them from index.ts
Any ideas?
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 25 (9 by maintainers)
Okay so after hours of debugging and constant white screens I was finally able to get everything working the way i want it. I have a few notes for anyone else that comes across these issues you might be able to link them back here to help.
react-router-dom
DOES work, but only theMemoryRouter
works with GAS’s sandbox, and you have to modify webpack becausemodule-to-cdn
doesn’t work withreact-router-dom
and the minified production package also caused issues. I did the following to fix it:this isn’t ideal but at least now
react-router-dom
is usable.Another thing that threw me for a loop was some constants I had defined and exported for use throughout my codebase. I had two
consts
with very similar names and for some reason it was causing the entire add on to white screen:I’m not sure what was happening with this one so if anyone figures it out let me know. I simply restructured and renames these to fix it.
Hm yea interesting. Out of curiosity is it the
import * ...
syntax, the export list separated into different lines, or combo of both that fixes it?I guess I’m kinda not too surprised. Something about the
autoGlobalExportsFiles
implementation requires the exports and maybe the imports to look a certain way, but it doesn’t exactly follow standard export formatting. I remember I tried to do stuff likeexport onOpen from './...'
andexport * from './...'
and they didn’t work, even if I tried installing the right babel plugins, that’s why I left that vague comment in that index.ts file.Could ask @fossamagna in https://github.com/fossamagna/gas-webpack-plugin if he knows what’s going on.