Open j3ffgray opened 1 week ago
ESM most definitely support top-level awaits! This error is typically due to some misconfiguration. I've seen it happen before, and the fix is usually messing with esbuild/rollup config files.
The underlying issue is that the the bundler/compiler used by svelte-adapter-appengine is too pessimistic about the target on which this code is going to run, so it bails.
AppEngine supports node22 now, which most definitely supports top-level awaits.
For example, here's the fix for this problem for esbuild/vite:
Hmmm, yeah, updating the vite.config.ts was the first thing I tried. I also tried manually setting the version of Node in the svelte config (for the app engine adapter), but I'm still receiving the build errors.
I'll keep poking around, thanks for the quick response!
One thing that might help -- I see that you're targeting CommonJS (cjs) -- why not use ESM?
I'm not attempting to target cjs, and I'm no wizard at Vite or Rollup, mostly just using the App Engine adapter Halfdanj created and using its stock configuration.
Any tips would be appreciated, but in the meantime, I've swapped Sveltekit adapters in favor of sveltekit-static, which has its own issues, but allowed me to deploy something to App engine that can run for the time being.
Behavior
Deploying a project using a framework like Svelte requires a package.json set to "type: "module".
ESM modules don't support top level await functions, two of which are present in GeminiKit.
Steps to Reproduce the Problem
I haven't found a solution yet, and I'm not familiar enough with the structure of the kits yet, so I don't have a fix but wanted to note it, as it prevents deploying experiments with certain OS tools.
Specifications
Error response when running
npm run build