Solid-start-vercel rollup error
Hey, I am trying to build my solidstart app with solid-start-vercel package included (it works just fine without it) and I am getting this error
I tried to search online and also in this DC server but haven't found anything quite like it. I know solid-start-vercel is experimental, I just couldn't manage to make my app work on vercel without it.
Thanks for help in advance.
19 Replies
Hi, are you able to show your vite config?
I could also share package.json or tsconfig if it were to help
Awesome, thanks
package.json
tsconfig
Does dev mode work?
Yeah, but I forgot I have edited vite config since I tried it in dev mode
I just updated it, one change, ssr set to false
Where are you using your googleapis dependency?
Since it's nodejs only
On the server side, I am using it for authorization
awesome
You may be able to add this
build: { target: "esnext" }
to your config
Or rollupOptions: { output: { format: "es" } }
It looks like one of your deps is cjs, but I've checked all of them on npm and they all seem to be es compatibleYeah, I have already tried both of these
Huh
I can't reproduce a build issue with your exact package.json, tsconfig, and vite config
I had the same thought, tried to make rollup produce "es" instead of "csj" output, but none of these made any change
That's really weird
Maybe try removing dependencies one by one, and you might eventually find what dep causes it
Maybe I'll try clearing node modules and package lock
That's probably a good thing to try first
So clearing didn't help, I went one by one
As I mention in original post, not using vercel as adapter makes it work
And when using vercel as adapter removing googlapis makes it work
I guess problem is somewhere between them, I'll try to find out, but at least I have some direction
Thank you for your help
Do vercel envs have access to node APIs? As google APIs fairly extensively uses node APIs I think. Maybe that's where the CJS problem lies?
You're welcome, I haven't really done much lol
I don't know, I'll look into it some more in the evening it could be the culprit
If it is the case I might simply stop using the googlapis package, I can probably write the auth routine without it
Solved the issue - it was indeed the googlapis, not the package itself, but the way I used it, one async call was outside of class and got to the top level during rollup processing. Thanks, you helped me a lot
Awesome