lloeki / matterfront

Mattermost frontend app for OS X, Windows and Linux
MIT License
152 stars 27 forks source link

Built app tries to connect to localhost:9000 #55

Closed teetrinkers closed 8 years ago

teetrinkers commented 8 years ago

This is on OS X 10.11.1, node 5.0.0, npm 3.4.1

lloeki commented 8 years ago

Seems it has to do with making use of webpack (7102eb6e1ceabf379759f525e7ee6d4e85d76685 and e7c4e0635212ff411f81c45656a748689090e18a)

In development, one should have npm run start-watch running before npm start is issued. The doc has failed to be updated on that point.

Sicne I'm discovering webpack right now, I have no idea how index.html is supposed to even work once a package is built. @geekytime?

geekytime commented 8 years ago

I had been working on that code in my fork, and then it got merged back here a bit prematurely. I was heads-down trying to get the new features working, and left webpack hot-loader server in place full time in the name of expedience. Then the code got merged, and I didn't even think about the fact that it was still in "dev mode".

My intention was to crank out these new features, and then set up a nicer set of tasks for switching between dev and build modes.

I can focus my energy on fixing the built app today. It shouldn't take long. If you need something right away, you should be able to go back a few commits and get a working build. If you really want to roll back those commits for now, that should work, too. We can always re-merge later on if you want.

Sorry for the mixup. I definitely should have thought of that when that code was merged.

BrianGilbert commented 8 years ago

I tried checking out the commit before webpack was added (https://github.com/lloeki/matterfront/commit/9ad6bdb4686f10ffe922f95c87ff0d6fe996f0f7) but get errors trying to build

> matterfront@1.1.0 build /Users/brian/Downloads/matterfront
> electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost

Packaging app for platform darwin x64 using electron v0.34.2
Command failed: /bin/sh -c npm prune --production
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/brian/.nvm/versions/node/v5.2.0/bin/node" "/Users/brian/.nvm/versions/node/v5.2.0/bin/npm" "prune" "--production"
npm ERR! node v5.2.0
npm ERR! npm  v3.3.12
npm ERR! path /private/var/folders/pb/bcrtd8117lddsg8wj8506ckm0000gn/T/electron-packager/darwin-x64/Matterfront-darwin-x64/Electron.app/Contents/Resources/app/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/private/var/folders/pb/bcrtd8117lddsg8wj8506ckm0000gn/T/electron-packager/darwin-x64/Matterfront-darwin-x64/Electron.app/Contents/Resources/app/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/pb/bcrtd8117lddsg8wj8506ckm0000gn/T/electron-packager/darwin-x64/Matterfront-darwin-x64/Electron.app/Contents/Resources/app/npm-debug.log

npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/brian/.nvm/versions/node/v5.2.0/bin/node" "/Users/brian/.nvm/versions/node/v5.2.0/bin/npm" "run" "build"
npm ERR! node v5.2.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! matterfront@1.1.0 build: `electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the matterfront@1.1.0 build script 'electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the matterfront package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost
npm ERR! You can get their info via:
npm ERR!     npm owner ls matterfront
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/brian/Downloads/matterfront/npm-debug.log
1.74s user 0.71s system 109% cpu 2.239s total
$ cat /Users/brian/Downloads/matterfront/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/brian/.nvm/versions/node/v5.2.0/bin/node',
1 verbose cli   '/Users/brian/.nvm/versions/node/v5.2.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@3.3.12
3 info using node@v5.2.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle matterfront@1.1.0~prebuild: matterfront@1.1.0
6 silly lifecycle matterfront@1.1.0~prebuild: no script for prebuild, continuing
7 info lifecycle matterfront@1.1.0~build: matterfront@1.1.0
8 verbose lifecycle matterfront@1.1.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle matterfront@1.1.0~build: PATH: /Users/brian/.nvm/versions/node/v5.2.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/brian/Downloads/matterfront/node_modules/.bin:/Users/brian/.nvm/versions/node/v5.2.0/bin:/Users/brian/.rbenv/shims:/Users/brian/.pip-apps/bin:/Users/brian/.composer/vendor/bin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/brian/.zgen/unixorn/jpb.zshplugin-master/bin:/Users/brian/.zgen/unixorn/git-extra-commands-master:/Users/brian/.zgen/skx/sysadmin-util-master:/Users/brian/.zgen/StackExchange/blackbox-master/bin
10 verbose lifecycle matterfront@1.1.0~build: CWD: /Users/brian/Downloads/matterfront
11 silly lifecycle matterfront@1.1.0~build: Args: [ '-c',
11 silly lifecycle   'electron-packager ./src Matterfront --out=dist --ignore=\'^/dist$\' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id=\'org.matterfront.app\' --app-version=$npm_package_version --helper-bundle-id=\'org.matterfront.app.helper\' --overwrite --icon=resources/mattermost' ]
12 silly lifecycle matterfront@1.1.0~build: Returned: code: 1  signal: null
13 info lifecycle matterfront@1.1.0~build: Failed to exec build script
14 verbose stack Error: matterfront@1.1.0 build: `electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/Users/brian/.nvm/versions/node/v5.2.0/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at EventEmitter.emit (events.js:173:7)
14 verbose stack     at ChildProcess.<anonymous> (/Users/brian/.nvm/versions/node/v5.2.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at ChildProcess.emit (events.js:173:7)
14 verbose stack     at maybeClose (internal/child_process.js:819:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:212:5)
15 verbose pkgid matterfront@1.1.0
16 verbose cwd /Users/brian/Downloads/matterfront
17 error Darwin 15.0.0
18 error argv "/Users/brian/.nvm/versions/node/v5.2.0/bin/node" "/Users/brian/.nvm/versions/node/v5.2.0/bin/npm" "run" "build"
19 error node v5.2.0
20 error npm  v3.3.12
21 error code ELIFECYCLE
22 error matterfront@1.1.0 build: `electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost`
22 error Exit status 1
23 error Failed at the matterfront@1.1.0 build script 'electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the matterfront package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     electron-packager ./src Matterfront --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-bundle-id='org.matterfront.app' --app-version=$npm_package_version --helper-bundle-id='org.matterfront.app.helper' --overwrite --icon=resources/mattermost
23 error You can get their info via:
23 error     npm owner ls matterfront
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
BrianGilbert commented 8 years ago

Only way I could get it to build atm was to download the 1.1.1 release and build from that.

geekytime commented 8 years ago

I opened #57 to try to resolve the dev-mode/build-mode conflicts caused by 39bbd20c90105bd9d207d908a32cd2b7cd7fc9b8.

BrianGilbert commented 8 years ago

Just confirming #57 fixes the build issue with master

lloeki commented 8 years ago

closed by merging #57.