thgh / vercel-sapper

Vercel builder for Sapper with SSR enabled
MIT License
191 stars 25 forks source link

502: BAD_GATEWAY #39

Closed andrisole92 closed 4 years ago

andrisole92 commented 4 years ago

Doing everything as it is in readme, my server.js:

import sirv from 'sirv';
import polka from 'polka';
import compression from 'compression';
import * as sapper from '@sapper/server';

const {PORT, NODE_ENV} = process.env;
const dev = NODE_ENV === 'development';

const app = polka(); // You can also use Express
polka.use(
  compression({threshold: 0}),
  sirv('static', {dev}),
  sapper.middleware()
)
  .listen(PORT, err => {
    if (err) console.log('error', err);
  });

export default app;

I have 2 warnings in Vercel logs:

20:41:01.773  
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
20:41:01.774  
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
antony commented 4 years ago

Did you try the demo app?