roxiness/routify-starter

Deploying to Heroku fails

Closed this issue · 7 comments

Hey,

By running or building locally, everything executes correctly, however once trying to deploy to Heroku, the following error is encountered:

remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! svelte-app@1.0.0 build: `routify -b && rollup -c`
remote: npm ERR! Exit status 1

I have made sure I am using the right versions, and have the right package.json configuration:

"scripts": {
    "build": "routify -b && rollup -c",
    "dev": "run-p dev:*",
    "dev:rollup": "rollup -c -w",
    "dev:routify": "routify",
    "start": "sirv public --no-clear",
    "check": "svelte-check --tsconfig ./tsconfig.json"
  },

After hours of research, I still cannot see what am I doing wrong, may I have some support here?

Is there not any more information than that about what went wrong?

Nothing that I would identify as meaningful.. here is the full log:

remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! svelte-app@1.0.0 build: `routify -b && rollup -c`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the svelte-app@1.0.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.8q2Jr/_logs/2022-01-12T00_16_58_607Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to *myappname*.
remote:
To https://git.heroku.com/*myappname*.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*myappname*.git'

Also the log file it suggests to read, cannot be found.

What node version is heroku running? and do you have a repo I can see or a minimal reproducible?

My current node version is v16.13.2 I don't think I lack any kind of installation or setup, since a project I was previously working on deploys without any issue, and this one is using the same setups and configurations (and still doesn't work, unfortunately).
I have made my repo public, you should be able to see it.

I have found the solution. Unfortunately, my 'ui' folder started with a capital U. It has broken the deployment somehow, and it could not produce a proper error message on what went wrong. Not sure if it is a routify scenario or a general svelte case, but might be an interesting one to consider later on.

It's most likely a windows issue. Since windows files are case insensitive and the rest of the worlds aren't sometimes you actually have two of the same folder in a sense?

Heroku will run on linux which cares whether you are importing ./Ui/x or ./ui/x for example, since on linux these are different but on windows either is valid (regardless of whether they both exist)