React-Google-Apps-Script icon indicating copy to clipboard operation
React-Google-Apps-Script copied to clipboard

[Help needed] - How to use scriptlets?

Open mohdabidansari opened this issue 1 year ago • 3 comments

Tried using scriplets in my frontend code but the transformed code resulted in errors.

Code const SHEET_ID = JSON.parse('<?= JSON.stringify(activeSheetId) ?>'); console.log({ SHEET_ID });

Error when running the app Uncaught SyntaxError: missing ) after argument list (at userCodeAppPanel:3:6838)

mohdabidansari avatar Jul 02 '24 06:07 mohdabidansari

Scriptlets aren't supported here.

enuchi avatar Jul 02 '24 11:07 enuchi

So what's the workaround? Is there any other solution apart from making a request sing serverFunctions when the app loads?

mohdabidansari avatar Jul 08 '24 04:07 mohdabidansari

See https://github.com/enuchi/React-Google-Apps-Script/issues/209#issuecomment-1962322152

enuchi avatar Jul 08 '24 13:07 enuchi