No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how to deploy SPA to Heroku?

    Help
    7
    9
    1385
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jordan last edited by

      Recently I deployed my SPA project from Github to Heroku. Everything seems right but it built failed.
      I used Express as Backend server, and I have set up the script in package.json as:

        "scripts": {
          "build": "quasar build",
          "start": "node server.js",
          "heroku-postbuild": "cd client && npm install && yarn && yarn build"
        }
      

      The build log complained that ‘sh: 1: yarn: not found’. I then changed the configs to:

        "scripts": {
          "build": "quasar build",
          "start": "node server.js",
          "heroku-postbuild": "cd client && npm install && quasar build"
        }
      

      but the build logs still complained ‘sh: 1: quasar: not found’. What do I miss? Thank you.

      1 Reply Last reply Reply Quote 1
      • T
        toregard last edited by

        Good question. Confusing and missing information.

        1 Reply Last reply Reply Quote 1
        • E
          emmajnr last edited by

          npm install -g @quasar/cli

          M 1 Reply Last reply Reply Quote 0
          • M
            Mickey58 @emmajnr last edited by Mickey58

            @Jordan

            The script section of my SPA on Heroku looks like this:

              "scripts": {
                "build": "quasar build",
                "start": "node front-end-server.js",
                "heroku-postbuild": "npm install --only=dev --no-shrinkwrap && npm run build"
              },
            
            P B 2 Replies Last reply Reply Quote 2
            • P
              placiderapson @Mickey58 last edited by

              @Mickey58 Thank you. By using that exact heroku-postbuild has fixed the deployment issue: quasar not found, thus deployed the SPA successfully.

              1 Reply Last reply Reply Quote 1
              • B
                bretonio @Mickey58 last edited by

                Thank you @Mickey58 … that postbuild script worked for me just as you wrote it.

                1 Reply Last reply Reply Quote 0
                • J
                  jc_71950 last edited by

                  This used to work…until today (February 2, 2021).
                  I completely removed the heroku-postbuild line and it started working again.

                  1 Reply Last reply Reply Quote 0
                  • M
                    Mickey58 last edited by

                    @jc_71950 - that’s not consistent with my experience.

                    I still use the above heroku-postbuild: “npm install --only=dev --no-shrinkwrap && npm run build” for Heroku builds and it works perfectly, since about a year.

                    1 Reply Last reply Reply Quote 0
                    • M
                      Mickey58 last edited by Mickey58

                      @jc_71950 - today my Heroku build (which has been working successfully until yesterday, with the above statement) failed, with strange dependency related errors. So now I’ve been hit by the same issue like you a few days earlier.

                      After several unsuccessful attempts to correct it; I removed the above statement…now the Heroku build works again, without that statement. Very strange, not sure what changed at Heroku, NPM, or Quasar, causing that issue.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post