Title: Cannot read property 'length' of undefined · Issue #112 · NativeScript/nativescript-dev-webpack · GitHub
Open Graph Title: Cannot read property 'length' of undefined · Issue #112 · NativeScript/nativescript-dev-webpack
X Title: Cannot read property 'length' of undefined · Issue #112 · NativeScript/nativescript-dev-webpack
Description: Hi, Just tried running nativescript-dev-webpack and got this error below; Seems like a typescript error, but I'm at 2.1.6 already; any ideas on where to look next? Safely@0.2.0 build-android-bundle /Users/jeric/Downloads/project_safely/c...
Open Graph Description: Hi, Just tried running nativescript-dev-webpack and got this error below; Seems like a typescript error, but I'm at 2.1.6 already; any ideas on where to look next? Safely@0.2.0 build-android-bundle...
X Description: Hi, Just tried running nativescript-dev-webpack and got this error below; Seems like a typescript error, but I'm at 2.1.6 already; any ideas on where to look next? Safely@0.2.0 build-android-bu...
Opengraph URL: https://github.com/NativeScript/nativescript-dev-webpack/issues/112
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot read property 'length' of undefined","articleBody":"Hi,\r\n\r\nJust tried running nativescript-dev-webpack and got this error below;\r\nSeems like a typescript error, but I'm at 2.1.6 already; any ideas on where to look next?\r\n\r\n```\r\nSafely@0.2.0 build-android-bundle /Users/jeric/Downloads/project_safely/code/mobile-nativescript\r\nnpm run ns-bundle --android --build-app\r\n\r\nSafely@0.2.0 ns-bundle /Users/jeric/Downloads/project_safely/code/mobile-nativescript\r\nns-bundle\r\n\r\nRunning webpack for android...\r\n/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:14552\r\n var sourceFile = new SourceFileConstructor(261 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length);\r\n ^ \r\n\r\nTypeError: Cannot read property 'length' of undefined\r\n at createSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:14552:109)\r\n at parseSourceFileWorker (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:14484:26)\r\n at Object.parseSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:14433:26)\r\n at Object.createSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:14288:29)\r\n at WebpackCompilerHost.getSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/@ngtools/webpack/src/compiler_host.js:210:27)\r\n at findSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63453:29)\r\n at processSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63384:27)\r\n at /Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63494:17\r\n at Object.forEach (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:1293:30)\r\n at processReferencedFiles (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63492:16)\r\n at findSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63477:21)\r\n at processSourceFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63384:27)\r\n at processRootFile (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:63271:13)\r\n at /Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:62620:60\r\n at Object.forEach (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:1293:30)\r\n at Object.createProgram (/Users/jeric/Downloads/project_safely/code/mobile-nativescript/node_modules/typescript/lib/typescript.js:62620:16)\r\nchild process exited with code 1\r\n```\r\n\r\npackage.json:\r\n```\r\n{\r\n \"name\": \"Safely\",\r\n \"version\": \"0.2.0\",\r\n \"description\": \"SHC Locator App for: Save the Children\",\r\n \"readme\": \"README.md\",\r\n \"author\": \"Jeric de Leon \u003cjericpaul.deleon@gmail.com> (http://jericdeleon.com)\",\r\n \"license\": \"MIT\",\r\n \"repository\": \"gitlab:savethechildren-ict/mobile-nativescript\",\r\n \"nativescript\": {\r\n \"id\": \"org.nativescript.safely\",\r\n \"tns-android\": {\r\n \"version\": \"2.5.0\"\r\n }\r\n },\r\n \"dependencies\": {\r\n \"@angular/common\": \"4.0.0\",\r\n \"@angular/compiler\": \"4.0.0\",\r\n \"@angular/core\": \"4.0.0\",\r\n \"@angular/forms\": \"4.0.0\",\r\n \"@angular/http\": \"4.0.0\",\r\n \"@angular/platform-browser\": \"4.0.0\",\r\n \"@angular/platform-browser-dynamic\": \"4.0.0\",\r\n \"@angular/router\": \"4.0.0\",\r\n \"email-validator\": \"^1.0.7\",\r\n \"nativescript-angular\": \"1.5.1\",\r\n \"nativescript-angular-snapshot\": \"1.5.1-5.5.372.32\",\r\n \"nativescript-directions\": \"^1.0.4\",\r\n \"nativescript-geolocation\": \"0.0.15\",\r\n \"nativescript-google-maps-sdk\": \"^1.3.14\",\r\n \"nativescript-ng2-fonticon\": \"^1.3.3\",\r\n \"nativescript-permissions\": \"^1.2.1\",\r\n \"nativescript-phone\": \"^1.2.3\",\r\n \"nativescript-photoviewer\": \"1.0.0\",\r\n \"nativescript-plugin-firebase\": \"^3.8.3\",\r\n \"nativescript-telerik-ui-pro\": \"nativescript-ui-pro.tgz\",\r\n \"reflect-metadata\": \"~0.1.8\",\r\n \"rxjs\": \"~5.2.0\",\r\n \"tns-core-modules\": \"2.5.2\",\r\n \"zone.js\": \"~0.8.2\"\r\n },\r\n \"devDependencies\": {\r\n \"@angular/compiler-cli\": \"~4.0.0\",\r\n \"@ngtools/webpack\": \"1.2.13\",\r\n \"babel-traverse\": \"6.19.0\",\r\n \"babel-types\": \"6.19.0\",\r\n \"babylon\": \"6.14.0\",\r\n \"copy-webpack-plugin\": \"~3.0.1\",\r\n \"extract-text-webpack-plugin\": \"~2.0.0-beta.4\",\r\n \"lazy\": \"1.0.11\",\r\n \"nativescript-css-loader\": \"~0.26.0\",\r\n \"nativescript-dev-android-snapshot\": \"^0.*.*\",\r\n \"nativescript-dev-typescript\": \"~0.3.5\",\r\n \"nativescript-dev-webpack\": \"^0.3.7\",\r\n \"raw-loader\": \"~0.5.1\",\r\n \"resolve-url-loader\": \"~1.6.0\",\r\n \"typescript\": \"~2.1.0\",\r\n \"webpack\": \"2.2.0\",\r\n \"webpack-sources\": \"~0.1.3\"\r\n },\r\n \"scripts\": {\r\n \"ns-bundle\": \"ns-bundle\",\r\n \"start-android-bundle\": \"npm run ns-bundle --android --start-app\",\r\n \"start-ios-bundle\": \"npm run ns-bundle --ios --start-app\",\r\n \"build-android-bundle\": \"npm run ns-bundle --android --build-app\",\r\n \"build-ios-bundle\": \"npm run ns-bundle --ios --build-app\"\r\n }\r\n}\r\n```\r\n\r\nwebpack.common.js:\r\n```\r\nvar webpack = require(\"webpack\");\r\nvar nsWebpack = require(\"nativescript-dev-webpack\");\r\nvar nativescriptTarget = require(\"nativescript-dev-webpack/nativescript-target\");\r\nvar path = require(\"path\");\r\nvar CopyWebpackPlugin = require(\"copy-webpack-plugin\");\r\nvar ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\r\nvar AotPlugin = require(\"@ngtools/webpack\").AotPlugin;\r\n\r\nmodule.exports = function (platform, destinationApp) {\r\n if (!destinationApp) {\r\n //Default destination inside platforms/\u003cplatform>/...\r\n destinationApp = nsWebpack.getAppPath(platform);\r\n }\r\n var entry = {};\r\n //Discover entry module from package.json\r\n entry.bundle = \"./\" + nsWebpack.getEntryModule();\r\n //Vendor entry with third party libraries.\r\n entry.vendor = \"./vendor\";\r\n //app.css bundle\r\n entry[\"app.css\"] = \"./app.css\";\r\n\r\n var plugins = [\r\n new ExtractTextPlugin(\"app.css\"),\r\n //Vendor libs go to the vendor.js chunk\r\n new webpack.optimize.CommonsChunkPlugin({\r\n name: [\"vendor\"]\r\n }),\r\n //Define useful constants like TNS_WEBPACK\r\n new webpack.DefinePlugin({\r\n \"global.TNS_WEBPACK\": \"true\",\r\n }),\r\n //Copy assets to out dir. Add your own globs as needed.\r\n new CopyWebpackPlugin([\r\n { from: \"app.css\" },\r\n { from: \"css/**\" },\r\n { from: \"fonts/**\" },\r\n { from: \"**/*.jpg\" },\r\n { from: \"**/*.png\" },\r\n { from: \"**/*.xml\" },\r\n ], { ignore: [\"App_Resources/**\"] }),\r\n //Generate a bundle starter script and activate it in package.json\r\n new nsWebpack.GenerateBundleStarterPlugin([\r\n \"./vendor\",\r\n \"./bundle\",\r\n ]),\r\n\r\n //Angular AOT compiler\r\n new AotPlugin({\r\n tsConfigPath: \"tsconfig.aot.json\",\r\n entryModule: path.resolve(__dirname, \"app/app.module#AppModule\"),\r\n typeChecking: false\r\n }),\r\n new nsWebpack.StyleUrlResolvePlugin({platform}),\r\n ];\r\n\r\n if (process.env.npm_config_uglify) {\r\n plugins.push(new webpack.LoaderOptionsPlugin({\r\n minimize: true\r\n }));\r\n\r\n //Work around an Android issue by setting compress = false\r\n var compress = platform !== \"android\";\r\n plugins.push(new webpack.optimize.UglifyJsPlugin({\r\n mangle: {\r\n except: nsWebpack.uglifyMangleExcludes,\r\n },\r\n compress: compress,\r\n }));\r\n }\r\n\r\n return {\r\n context: path.resolve(\"./app\"),\r\n target: nativescriptTarget,\r\n entry: entry,\r\n output: {\r\n pathinfo: true,\r\n path: path.resolve(destinationApp),\r\n libraryTarget: \"commonjs2\",\r\n filename: \"[name].js\",\r\n },\r\n resolve: {\r\n //Resolve platform-specific modules like module.android.js\r\n extensions: [\r\n \".aot.ts\",\r\n \".ts\",\r\n \".js\",\r\n \".css\",\r\n \".\" + platform + \".ts\",\r\n \".\" + platform + \".js\",\r\n \".\" + platform + \".css\",\r\n ],\r\n //Resolve {N} system modules from tns-core-modules\r\n modules: [\r\n \"node_modules/tns-core-modules\",\r\n \"node_modules\"\r\n ]\r\n },\r\n node: {\r\n //Disable node shims that conflict with NativeScript\r\n \"http\": false,\r\n \"timers\": false,\r\n \"setImmediate\": false,\r\n \"fs\": \"empty\",\r\n },\r\n module: {\r\n loaders: [\r\n {\r\n test: /\\.html$|\\.xml$/,\r\n loaders: [\r\n \"raw-loader\",\r\n ]\r\n },\r\n // Root app.css file gets extracted with bundled dependencies\r\n {\r\n test: /app\\.css$/,\r\n loader: ExtractTextPlugin.extract([\r\n \"resolve-url-loader\",\r\n \"nativescript-css-loader\",\r\n \"nativescript-dev-webpack/platform-css-loader\",\r\n ]),\r\n },\r\n // Other CSS files get bundled using the raw loader\r\n {\r\n test: /\\.css$/,\r\n exclude: /app\\.css$/,\r\n loaders: [\r\n \"raw-loader\",\r\n ]\r\n },\r\n // Compile TypeScript files with ahead-of-time compiler.\r\n {\r\n test: /\\.ts$/,\r\n loaders: [\r\n \"nativescript-dev-webpack/tns-aot-loader\",\r\n \"@ngtools/webpack\",\r\n ]\r\n },\r\n // SASS support\r\n {\r\n test: /\\.scss$/,\r\n loaders: [\r\n \"raw-loader\",\r\n \"resolve-url-loader\",\r\n \"sass-loader\"\r\n ]\r\n },\r\n ]\r\n },\r\n plugins: plugins,\r\n };\r\n};\r\n```\r\n\r\n","author":{"url":"https://github.com/jericdeleon","@type":"Person","name":"jericdeleon"},"datePublished":"2017-04-08T01:36:28Z","url":"https://github.com/NativeScript/nativescript-dev-webpack/issues/112"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:08b845fd-2273-fdb4-cce4-7a7e86d404cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B96:299992:544F4B:6F7416:6B019D0A |
| html-safe-nonce | 126d15c518865530b31c1e20da30c9a16afc493066bc27448fb46a38e0ce257d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk2OjI5OTk5Mjo1NDRGNEI6NkY3NDE2OjZCMDE5RDBBIiwidmlzaXRvcl9pZCI6IjUzMjI2MzAwNjY5NDM5MjU1MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0240bdc406d3ca87225e3fcd3f8a33af65453269e547e85e66e4073d19b64f38 |
| hovercard-subject-tag | issue:220366015 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-dev-webpack/112/issue_layout |
| twitter:image | https://opengraph.githubassets.com/592d43b2cd352fe613867cc8a1dd70a9066d6f8b5adf7371682a383dcc43555d/NativeScript/nativescript-dev-webpack/issues/112 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/592d43b2cd352fe613867cc8a1dd70a9066d6f8b5adf7371682a383dcc43555d/NativeScript/nativescript-dev-webpack/issues/112 |
| og:image:alt | Hi, Just tried running nativescript-dev-webpack and got this error below; Seems like a typescript error, but I'm at 2.1.6 already; any ideas on where to look next? Safely@0.2.0 build-android-bundle... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jericdeleon |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-dev-webpack git https://github.com/NativeScript/nativescript-dev-webpack.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 54984270 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-dev-webpack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 54984270 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-dev-webpack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width