Closed dscherdi closed 3 years ago
Fixed by adding
if(dev) {
app.listen(PORT, () => {});
}
or removing .listen()
part
If you remove export default app
and then run npx vercel-sapper
it will apply a change that should work.
If you remove .listen()
you won't be able to fetch during SSR. Which may not be a problem for you.
Thanks that worked too, the problem was that .listen returns void, not Express object. Thanks for explanation.
Result![image](https://user-images.githubusercontent.com/32078781/90385460-7b2b6300-e083-11ea-862a-b052d1b26e5b.png)
My vercel.json![image](https://user-images.githubusercontent.com/32078781/90385543-98603180-e083-11ea-82fb-82e4a88c844a.png)
My package.json![image](https://user-images.githubusercontent.com/32078781/90385581-a57d2080-e083-11ea-8b63-a1ccf793813f.png)
My server.js![image](https://user-images.githubusercontent.com/32078781/90385633-b463d300-e083-11ea-9d2f-aed9d8136ced.png)
Output in vercel
Output folder in vercel![image](https://user-images.githubusercontent.com/32078781/90385953-263c1c80-e084-11ea-8a80-8ac27a627863.png)
Steps I took: