Lattyware/massivedecks

Unable to Deploy to Heroku

lhvy opened this issue · 7 comments

lhvy commented

Describe the bug

When deploying to Heroku, the client successfully builds but the server fails to build. Here is the important part of the log:

-----> Build
       Running build
       
       > massivedecks@2.0.0 build /tmp/build_a9709bdd_
       > cp -r server/decks decks && npm run buildServer && npm run buildClient
       
       
       > massivedecks@2.0.0 buildServer /tmp/build_a9709bdd_
       > npm explore @massivedecks/server -- npm run build
       
       
       > @massivedecks/server@2.0.0 build /tmp/build_a9709bdd_/server
       > npx tsc
       
npx: installed 1 in 1.385s
       error TS6047: Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.
       error TS6046: Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'.
       error TS5023: Unknown compiler option 'incremental'.
       error TS5023: Unknown compiler option 'resolveJsonModule'.
       error TS5023: Unknown compiler option 'strict'.
       error TS5023: Unknown compiler option 'strictNullChecks'.
       error TS5023: Unknown compiler option 'strictFunctionTypes'.
       error TS5023: Unknown compiler option 'strictBindCallApply'.
       error TS5023: Unknown compiler option 'strictPropertyInitialization'.
       error TS5023: Unknown compiler option 'noImplicitThis'.
       error TS5023: Unknown compiler option 'alwaysStrict'.
       error TS5023: Unknown compiler option 'noImplicitReturns'.
       error TS5023: Unknown compiler option 'noFallthroughCasesInSwitch'.
       error TS5023: Unknown compiler option 'moduleResolution'.
       error TS5023: Unknown compiler option 'allowSyntheticDefaultImports'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @massivedecks/server@2.0.0 build: `npx tsc`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @massivedecks/server@2.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

How to reproduce the bug

Steps to reproduce the behaviour:

  1. Use the Heroku deploy button on this repo's README.md
  2. Pick an application name and press the "Deploy app" button on Heroku.

Expected behaviour

When running a dev environment or building locally, everything works fine. The expected behaviour is that deploying to Heroku works successfully as it does on other platforms.

Ah, yeah, for some reason it seems to be pulling down an ancient version of the typescript compiler rather than the version we have listed—I'm guessing the two subprojects aren't getting their node_modules populated like they used to, for some reason.

Ah, yeah, for some reason it seems to be pulling down an ancient version of the typescript compiler rather than the version we have listed—I'm guessing the two subprojects aren't getting their node_modules populated like they used to, for some reason.

So what do we need to fi I am fairly new to web dev in case you could tell thank you

Sorry, I haven't had a chance to work out what is going on and the best way to fix it, for now the Heroku build is just broken unless someone can get to the bottom of why it isn't working any more.

lhvy commented

Ok so I did some testing, by changing typescript to a production dependency in server/package.json, I was able to make some progress in the right direction and have attached the log below. It now complains that there are no declaration files for a bunch of modules. I tried to move the other dev dependencies such as @types/express to prod but the build log still said the declaration files were missing.

https://pastebin.com/1RrW08yn (The log was a bit long, so I moved it to Pastebin.)

lhvy commented

Yeah, I realised I was wrong and deleted my comment shortly after sending. (Forgot about email replies. Oops!) Thanks for the clarification into the issue, I'll have a look at it soon since I host using Heroku and would like to get this working again.

lhvy commented

Tested again, and appears to be fixed as of 82b9513