noahlange / homebrewery-electron

Electron port of Natural Crit's Homebrewery app.
10 stars 6 forks source link

Running npm build script will error out after finishing. #5

Closed vSanjo closed 6 years ago

vSanjo commented 6 years ago

Hey


> homebrewery@0.1.0 build /Volumes/dev/self/homebrewery-electron
> tsc

node_modules/react-codemirror2/index.d.ts(2,23): error TS2688: Cannot find type definition file for 'react'.
src/editor.tsx(9,84): error TS2339: Property 'props' does not exist on type 'Editor'.
src/editor.tsx(10,22): error TS2339: Property 'props' does not exist on type 'Editor'.
src/editor.tsx(11,24): error TS2339: Property 'props' does not exist on type 'Editor'.
src/index.tsx(37,12): error TS2339: Property 'setState' does not exist on type 'App'.
src/index.tsx(40,12): error TS2339: Property 'setState' does not exist on type 'App'.
src/index.tsx(43,12): error TS2339: Property 'setState' does not exist on type 'App'.
src/index.tsx(46,12): error TS2339: Property 'setState' does not exist on type 'App'.
src/index.tsx(51,10): error TS2339: Property 'setState' does not exist on type 'App'.
src/preview.tsx(16,17): error TS2339: Property 'props' does not exist on type 'Preview'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! homebrewery@0.1.0 build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the homebrewery@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/{user}/.npm/_logs/2017-11-08T07_35_34_077Z-debug.log

It looks like an issue with how npm handles the tsc command. tsc is actually finishing correctly despite throwing warnings out (and can be tested by just running tsc if it's installed globally).

An easy, 'hacky' fix is to just throw a truthy result after the command.

"scripts": {
    "sass": "sass --watch scss:assets",
    "build": "tsc || true",
    "start": "electron .",
    "watch": "tsc --watch"
  }

I'll look into exactly what causes this and see if we can mitigate it, but this hotfix might stop people less technologically inclined panicking.

I can set up a pull-request later but it's a very simple change for the time being.

noahlange commented 6 years ago

I can't reproduce this, but it looks like it's missing React types. I added the relevant package to the manifest, it should take care of this issue. Give it a pull and let me know if it still doesn't work.