{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/393","repository_url":"https://api.github.com/repos/driftyco/ionic-app-scripts","labels_url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/393/comments","events_url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/393/events","html_url":"https://github.com/driftyco/ionic-app-scripts/issues/393","id":189349631,"number":393,"title":"Custom webpack config file makes the prod build fail","user":{"login":"rolandjitsu","id":1479737,"avatar_url":"https://avatars.githubusercontent.com/u/1479737?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandjitsu","html_url":"https://github.com/rolandjitsu","followers_url":"https://api.github.com/users/rolandjitsu/followers","following_url":"https://api.github.com/users/rolandjitsu/following{/other_user}","gists_url":"https://api.github.com/users/rolandjitsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandjitsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandjitsu/subscriptions","organizations_url":"https://api.github.com/users/rolandjitsu/orgs","repos_url":"https://api.github.com/users/rolandjitsu/repos","events_url":"https://api.github.com/users/rolandjitsu/events{/privacy}","received_events_url":"https://api.github.com/users/rolandjitsu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"danbucholtz","id":4680488,"avatar_url":"https://avatars.githubusercontent.com/u/4680488?v=3","gravatar_id":"","url":"https://api.github.com/users/danbucholtz","html_url":"https://github.com/danbucholtz","followers_url":"https://api.github.com/users/danbucholtz/followers","following_url":"https://api.github.com/users/danbucholtz/following{/other_user}","gists_url":"https://api.github.com/users/danbucholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/danbucholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbucholtz/subscriptions","organizations_url":"https://api.github.com/users/danbucholtz/orgs","repos_url":"https://api.github.com/users/danbucholtz/repos","events_url":"https://api.github.com/users/danbucholtz/events{/privacy}","received_events_url":"https://api.github.com/users/danbucholtz/received_events","type":"User","site_admin":false},"assignees":[{"login":"danbucholtz","id":4680488,"avatar_url":"https://avatars.githubusercontent.com/u/4680488?v=3","gravatar_id":"","url":"https://api.github.com/users/danbucholtz","html_url":"https://github.com/danbucholtz","followers_url":"https://api.github.com/users/danbucholtz/followers","following_url":"https://api.github.com/users/danbucholtz/following{/other_user}","gists_url":"https://api.github.com/users/danbucholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/danbucholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbucholtz/subscriptions","organizations_url":"https://api.github.com/users/danbucholtz/orgs","repos_url":"https://api.github.com/users/danbucholtz/repos","events_url":"https://api.github.com/users/danbucholtz/events{/privacy}","received_events_url":"https://api.github.com/users/danbucholtz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-11-15T10:08:51Z","updated_at":"2016-12-05T11:31:51Z","closed_at":null,"body":"**Note: for support questions, please use one of these channels:**\r\n\r\nhttps://forum.ionicframework.com/\r\nhttp://ionicworldwide.herokuapp.com/\r\n\r\n\r\n#### Short description of the problem:\r\nI seems that if I use\r\n```js\r\n\"config\": {\r\n\t\"ionic_webpack\": \"./config/webpack.config.js\"\r\n}\r\n```\r\nThe prod builds fail with:\r\n```shell\r\n➜  operator git:(master) ✗ npm run ionic:build\r\n\r\n> @infarm/operator@0.0.0 ionic:build /Users/rolandjitsu/Projects/infarm/operator\r\n> ionic-app-scripts build\r\n\r\n[12:03:17]  ionic-app-scripts 0.0.43 \r\n[12:03:18]  build prod started ... \r\n[12:03:18]  clean started ... \r\n[12:03:18]  clean finished in 4 ms \r\n[12:03:18]  copy started ... \r\n[12:03:18]  ngc started ... \r\n[12:03:18]  copy finished in 138 ms \r\n[12:03:39]  ngc finished in 21.04 s \r\n[12:03:39]  webpack started ... \r\n[12:03:39]  build prod failed: Cannot read property 'type' of undefined \r\n[12:03:39]  ionic-app-script task: \"build\" \r\n[12:03:39]  TypeError: Cannot read property 'type' of undefined \r\n```\r\n\r\n#### What behavior are you expecting?\r\nTo build properly without errors.\r\n\r\n**Steps to reproduce:**\r\n1. Run `npm run ionic:build` with the custom config file provided bellow\r\n\r\n```\r\n// For reference, check the following:\r\n// https://github.com/driftyco/ionic-app-scripts/blob/master/config/webpack.config.js\r\n// Config borrowed from: https://github.com/driftyco/ionic-cli/issues/1205#issuecomment-257634690\r\nconst path = require('path');\r\nconst webpack = require('webpack');\r\n\r\nconst ionicWebpackFactoryPath = path.join(process.env.IONIC_APP_SCRIPTS_DIR, 'dist', 'webpack', 'ionic-webpack-factory.js');\r\nconst ionicWebpackFactory = require(ionicWebpackFactoryPath);\r\n\r\n\r\nfunction getEntryPoint() {\r\n\tif (process.env.IONIC_ENV === 'prod') {\r\n\t\treturn '{{TMP}}/app/main.prod.js';\r\n\t}\r\n\treturn '{{SRC}}/app/main.dev.ts';\r\n}\r\n\r\nfunction getDevtool() {\r\n\tif (process.env.IONIC_ENV === 'prod') {\r\n\t\t// For now, just force source-map for prod builds.\r\n\t\treturn 'source-map';\r\n\t}\r\n\treturn process.env.IONIC_SOURCE_MAP;\r\n}\r\n\r\nfunction getSourcemapLoader() {\r\n\tif (process.env.IONIC_ENV === 'prod') {\r\n\t\t// TODO figure out the disk loader, it's not working yet\r\n\t\treturn [];\r\n\t}\r\n\r\n\treturn [\r\n\t\t{\r\n\t\t\ttest: /\\.ts$/,\r\n\t\t\tloader: path.join(process.env.IONIC_APP_SCRIPTS_DIR, 'dist', 'webpack', 'typescript-sourcemap-loader-memory.js')\r\n\t\t}\r\n\t];\r\n}\r\n\r\nfunction getPlugins() {\r\n\tconst plugins = [\r\n\t\tnew webpack.DefinePlugin({\r\n\t\t\t'IONIC_ENV': JSON.stringify(process.env.IONIC_ENV)\r\n\t\t})\r\n\t];\r\n\r\n\tif (process.env.IONIC_ENV === 'prod') {\r\n\t\treturn plugins.push(\r\n\t\t\t// This helps ensure the builds are consistent if source hasn't changed:\r\n\t\t\tnew webpack.optimize.OccurrenceOrderPlugin(),\r\n\r\n\t\t\t// Try to dedupe duplicated modules, if any:\r\n\t\t\tnew webpack.optimize.DedupePlugin()\r\n\t\t);\r\n\t} else {\r\n\t\t// For dev builds, use Ionic custom environment.\r\n\t\tplugins.push(ionicWebpackFactory.getIonicEnvironmentPlugin());\r\n\t}\r\n\r\n\treturn plugins;\r\n}\r\n\r\n\r\nmodule.exports = {\r\n\tentry: getEntryPoint(),\r\n\toutput: {\r\n\t\tpath: '{{BUILD}}',\r\n\t\tfilename: 'main.js'\r\n\t},\r\n\tdevtool: getDevtool(),\r\n\tresolve: {\r\n\t\textensions: ['.js', '.ts', '.json']\r\n\t},\r\n\tmodule: {\r\n\t\tloaders: [\r\n\t\t\t{\r\n\t\t\t\ttest: /\\.json$/,\r\n\t\t\t\tloader: 'json'\r\n\t\t\t}\r\n\t\t].concat(getSourcemapLoader())\r\n\t},\r\n\tplugins: getPlugins(),\r\n\tnode: {\r\n\t\tfs: 'empty',\r\n\t\tnet: 'empty',\r\n\t\ttls: 'empty'\r\n\t}\r\n};\r\n```\r\n\r\n**Which @ionic/app-scripts version are you using?**\r\n`0.0.43`\r\n\r\n**Other information:** (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)\r\nFull npm error log:\r\n```\r\n0 info it worked if it ends with ok\r\n1 verbose cli [ '/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin/node',\r\n1 verbose cli   '/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin/npm',\r\n1 verbose cli   'run',\r\n1 verbose cli   'ionic:build' ]\r\n2 info using npm@3.10.3\r\n3 info using node@v6.7.0\r\n4 verbose run-script [ 'preionic:build', 'ionic:build', 'postionic:build' ]\r\n5 info lifecycle @infarm/operator@0.0.0~preionic:build: @infarm/operator@0.0.0\r\n6 silly lifecycle @infarm/operator@0.0.0~preionic:build: no script for preionic:build, continuing\r\n7 info lifecycle @infarm/operator@0.0.0~ionic:build: @infarm/operator@0.0.0\r\n8 verbose lifecycle @infarm/operator@0.0.0~ionic:build: unsafe-perm in lifecycle true\r\n9 verbose lifecycle @infarm/operator@0.0.0~ionic:build: PATH: /Users/rolandjitsu/.nvm/versions/node/v6.7.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/rolandjitsu/Projects/infarm/operator/node_modules/.bin:/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin:/Users/rolandjitsu/.rvm/gems/ruby-2.1.2/bin:/Users/rolandjitsu/.rvm/gems/ruby-2.1.2@global/bin:/Users/rolandjitsu/.rvm/rubies/ruby-2.1.2/bin:/Users/rolandjitsu/.cabal/bin:/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/rolandjitsu/.rvm/bin:/usr/local/opt/go/libexec/bin:/Users/rolandjitsu/Projects/go/bin:/Users/rolandjitsu/Projects/infarm/operator/node_modules/.bin\r\n10 verbose lifecycle @infarm/operator@0.0.0~ionic:build: CWD: /Users/rolandjitsu/Projects/infarm/operator\r\n11 silly lifecycle @infarm/operator@0.0.0~ionic:build: Args: [ '-c', 'ionic-app-scripts build' ]\r\n12 silly lifecycle @infarm/operator@0.0.0~ionic:build: Returned: code: 1  signal: null\r\n13 info lifecycle @infarm/operator@0.0.0~ionic:build: Failed to exec ionic:build script\r\n14 verbose stack Error: @infarm/operator@0.0.0 ionic:build: `ionic-app-scripts build`\r\n14 verbose stack Exit status 1\r\n14 verbose stack     at EventEmitter.<anonymous> (/Users/rolandjitsu/.nvm/versions/node/v6.7.0/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)\r\n14 verbose stack     at emitTwo (events.js:106:13)\r\n14 verbose stack     at EventEmitter.emit (events.js:191:7)\r\n14 verbose stack     at ChildProcess.<anonymous> (/Users/rolandjitsu/.nvm/versions/node/v6.7.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)\r\n14 verbose stack     at emitTwo (events.js:106:13)\r\n14 verbose stack     at ChildProcess.emit (events.js:191:7)\r\n14 verbose stack     at maybeClose (internal/child_process.js:877:16)\r\n14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)\r\n15 verbose pkgid @infarm/operator@0.0.0\r\n16 verbose cwd /Users/rolandjitsu/Projects/infarm/operator\r\n17 error Darwin 16.1.0\r\n18 error argv \"/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin/node\" \"/Users/rolandjitsu/.nvm/versions/node/v6.7.0/bin/npm\" \"run\" \"ionic:build\"\r\n19 error node v6.7.0\r\n20 error npm  v3.10.3\r\n21 error code ELIFECYCLE\r\n22 error @infarm/operator@0.0.0 ionic:build: `ionic-app-scripts build`\r\n22 error Exit status 1\r\n23 error Failed at the @infarm/operator@0.0.0 ionic:build script 'ionic-app-scripts build'.\r\n23 error Make sure you have the latest version of node.js and npm installed.\r\n23 error If you do, this is most likely a problem with the @infarm/operator package,\r\n23 error not with npm itself.\r\n23 error Tell the author that this fails on your system:\r\n23 error     ionic-app-scripts build\r\n23 error You can get information on how to open an issue for this project with:\r\n23 error     npm bugs @infarm/operator\r\n23 error Or if that isn't available, you can get their info via:\r\n23 error     npm owner ls @infarm/operator\r\n23 error There is likely additional logging output above.\r\n24 verbose exit [ 1, true ]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/comments/264831692","html_url":"https://github.com/driftyco/ionic-app-scripts/issues/393#issuecomment-264831692","issue_url":"https://api.github.com/repos/driftyco/ionic-app-scripts/issues/393","id":264831692,"user":{"login":"rolandjitsu","id":1479737,"avatar_url":"https://avatars.githubusercontent.com/u/1479737?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandjitsu","html_url":"https://github.com/rolandjitsu","followers_url":"https://api.github.com/users/rolandjitsu/followers","following_url":"https://api.github.com/users/rolandjitsu/following{/other_user}","gists_url":"https://api.github.com/users/rolandjitsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandjitsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandjitsu/subscriptions","organizations_url":"https://api.github.com/users/rolandjitsu/orgs","repos_url":"https://api.github.com/users/rolandjitsu/repos","events_url":"https://api.github.com/users/rolandjitsu/events{/privacy}","received_events_url":"https://api.github.com/users/rolandjitsu/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T11:31:51Z","updated_at":"2016-12-05T11:31:51Z","body":"@danbucholtz Unfortunately I already had `\"@types/node\": \"^6.0.46\"` installed and no luck. But I can wait until the feature is released, I'm using rollup for now."}}
{"actor":{"display_login":"rolandjitsu"}}