SSR Deployment with Now



  • Hi,
    I created a sample project with quasar create <pr>, and locally all is perfect. Now, I’m trying to learn how to do a simple SSR or even SPA deployment, by following the instructions, but once deployed I get errors, and no luck to get application going.

    The error:

    502
    Type: NO_STATUS_CODE_FROM_LAMBDA
    
    The Lambda responsible for the path you tried to access did not reply with a status code.
    

    Does anyone have a sample of now.json or some advice what am I doing wrong?

    My now.json:

    {
      "version": 2,
      "builds": [
        { "src": "index.js", "use": "@now/node" }
    
      ],
      "routes": [{ "src": "/", "dest": "index.js" }]
    }
    

    Thanks


  • Admin

    Use “Now” version 1 deployment.



  • Thanks Razvan, still complains, but maybe because I installed the latest version of “Now”:

    > Error! You tried to create a Now 1.0 deployment. Please use Now 2.0 instead: https://zeit.co/upgrade
    

    Is there maybe a sample of deploying directly to AWS through Serverless?

    Thanks



  • I’m having the same problem when trying to deploy

    0_1552965384949_02295cbe-560c-467a-98ff-ceeee08265d0-image.png


  • Admin

    @racingfox just to put this to rest: the docs website itself is Quasar SSR using Now 1.0

    @patryckx these are errors from your app. Have you checked the SSR build before deploying?



  • This post is deleted!




  • This is how to make Zeit Now work with Quasar

    1. Log into Zeit Now https://zeit.co/
    2. Create a project or import project from Github etc.
    3. Go into Build & Development Settings

    If SPA mode
    Add the following build command: quasar build
    Add the following output directory if SPA: /dist/spa

    If PWA mode
    Add build command: quasar build --mode pwa
    Add the following output directory: /dist/pwa

    If SSR mode
    Add build command: quasar build --mode ssr
    Add the following output directory: /dist/ssr

    If SSR + PWA mode
    Add build command: quasar build --mode ssr & quasar build --mode pwa
    Add the following output directory: /dist/ssr

    Press save when done.

    1. That’s it! You may now try to deploy your project to Zeit Now, and it should work 🙂

    In order to support SPA routing in the deployed app, consider adding now.json file in your root folder:
    {
    “routes”: [
    { “handle”: “filesystem” },
    { “src”: “/.*”, “dest”: “/index.html” }
    ]
    }


Log in to reply