NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

TypeError: Cannot read property 'match' of undefined when executing start-ios-bundle #33

Closed ignaciolarranaga closed 7 years ago

ignaciolarranaga commented 7 years ago

I moved from the old approach for webpack to the new one, that I just realize it was, but when trying to run the scripts as per the instructions I got this error. It seems request is repeated twice, but just guessing.

Stack trace:

$ npm run start-ios-bundle

> gynto@1.1.6 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.6 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.6 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.6 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

  0% compile/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:166
            if (request.request.match(/\.ts$/)) {
                               ^

TypeError: Cannot read property 'match' of undefined
    at Tapable.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:166:32)
    at Tapable.applyPlugins (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:26:37)
    at Tapable.resolve (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/enhanced-resolve/lib/Resolver.js:30:7)
    at Tapable.resolve (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:23:14)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:82:29
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/async/lib/async.js:718:13
    at async.forEachOf.async.eachOf (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/async/lib/async.js:233:13)
    at _parallel (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/async/lib/async.js:717:9)
    at Object.async.parallel (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/async/lib/async.js:731:9)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:75:10
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:28:4
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:159:3
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:75:69)
    at NormalModuleFactory.create (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:144:8)
    at Compilation.process [as _addModuleChain] (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:356:16)
    at Compilation.process [as addEntry] (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:424:7)
    at SingleEntryPlugin.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/SingleEntryPlugin.js:22:15)
    at Compiler.applyPluginsParallel (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:107:14)
    at Compiler.compile (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:394:7)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:173:9)
    at Compiler.readRecords (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:302:10)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:170:8)
    at Compiler.next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:67:11)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js:23:3)
    at Compiler.next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:69:14)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/CachePlugin.js:22:58)
    at Compiler.applyPluginsAsync (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:71:13)
    at Compiler.run (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:167:7)
    at processOptions (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/bin/webpack.js:188:12)
    at Object.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/bin/webpack.js:192:1)
hdeshev commented 7 years ago

It looks like a version mismatch error. The @ng-tools/webpack plugin is very brittle and works for predefined Angular versions.

Could you confirm that your package.json uses Angular 2.2.1, @ng-tools/webpack 1.6, and the correct version of all the webpack-related packages? The easiest way to add that is to install the plugin to a new app, and check the updated package.json.

ignaciolarranaga commented 7 years ago

Just did that and the only difference I found was Typescript so I changed it to match. The error changed, but still without working, I think now it is related to the typescript version.

Here is the fresh project package.json dependencies:

"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/router": "3.2.1",
    "nativescript-angular": "1.2.0",
    "nativescript-theme-core": "^0.2.1",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "2.4.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "2.2.1",
    "@ngtools/webpack": "1.1.6",
    "copy-webpack-plugin": "~3.0.1",
    "css-loader": "~0.26.0",
    "extract-text-webpack-plugin": "~2.0.0-beta.4",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "^0.3.2",
    "nativescript-dev-webpack": "^0.2.12",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~1.6.0",
    "typescript": "~2.0.10",
    "webpack": "~2.1.0-beta.27",
    "zone.js": "~0.6.21"
  },

here are mine:

"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/router": "3.2.1",
    "buffer": "4.6.0",
    "google-libphonenumber": "^2.0.1",
    "nativescript-angular": "1.2.0",
    "nativescript-background-http": "2.4.0",
    "nativescript-fcuuid": "1.0.2",
    "nativescript-geolocation": "0.0.15",
    "nativescript-google-analytics": "0.3.0",
    "nativescript-google-maps-sdk": "1.4.1",
    "nativescript-imagepicker": "file:../nativescript-imagepicker/nativescript-imagepicker",
    "nativescript-iqkeyboardmanager": "1.0.1",
    "nativescript-permissions": "1.2.1",
    "nativescript-phone": "1.1.0",
    "nativescript-purchase": "1.0.1",
    "nativescript-push-notifications": "0.0.19",
    "nativescript-unit-test-runner": "^0.3.3",
    "ng2-translate": "4.0.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "2.4.2",
    "validator": "5.7.0"
  },
  "devDependencies": {
    "@angular/compiler-cli": "2.2.1",
    "@ngtools/webpack": "1.1.6",
    "@types/jasmine": "^2.2.34",
    "babel-traverse": "6.19.0",
    "babel-types": "6.19.0",
    "babylon": "6.14.1",
    "copy-webpack-plugin": "~3.0.1",
    "css-loader": "~0.26.0",
    "extract-text-webpack-plugin": "~2.0.0-beta.4",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-jasmine": "^1.0.2",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.3.2",
    "nativescript-dev-webpack": "^0.2.12",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~1.6.0",
    "typescript": "~2.0.10",
    "webpack": "~2.1.0-beta.27",
    "zone.js": "~0.6.21"
  },

here is the updated version after change the package.json:

$ npm install
gynto@1.1.7 /Users/ignacio/Workspaces/Gynto/gynto-client
├─┬ @ngtools/webpack@1.1.6
│ └─┬ @angular-cli/ast-tools@1.0.10
│   └── typescript@2.0.10 
└── typescript@2.0.10 

and here is the new error:

$ npm run start-ios-bundle

> gynto@1.1.7 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.7 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.7 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.7 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

  0% compiling/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/static_reflector.js:473
                    throw positionalError(message, e.fileName, e.line, e.column);
                    ^

Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 35:25 in the original .ts file), resolving symbol AppModule in /Users/ignacio/Workspaces/Gynto/gynto-client/app/app.module.ts
    at positionalError (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/static_reflector.js:595:18)
    at simplifyInContext (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/static_reflector.js:473:27)
    at StaticReflector.simplify (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/static_reflector.js:478:22)
    at StaticReflector.annotations (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/static_reflector.js:60:36)
    at NgModuleResolver.resolve (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:14261:46)
    at CompileMetadataResolver._loadNgModuleMetadata (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:14646:45)
    at CompileMetadataResolver.getUnloadedNgModuleMetadata (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:14636:23)
    at addNgModule (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12944:43)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12957:16
    at Array.forEach (native)
    at _createNgModules (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12956:28)
    at analyzeNgModules (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12700:16)
    at analyzeAndValidateNgModules (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12704:20)
    at OfflineCompiler.compileModules (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12775:20)
    at CodeGenerator.codegen (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/codegen.js:58:30)
    at AotPlugin._make (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:193:43)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:157:75)
    at Compiler.applyPluginsParallel (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:193:14)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:468:8
    at Compiler.applyPluginsAsyncSeries (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:95:46)
    at Compiler.compile (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:461:7)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:222:10
    at Compiler.readRecords (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:371:10)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:219:9
    at next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:102:11)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/CachePlugin.js:34:58)
    at Compiler.applyPluginsAsyncSeries (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:106:13)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:216:8
    at next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:102:11)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js:23:3)
hdeshev commented 7 years ago

This new error can be caused by a problem in your NgModule definition. Do you have any providers that need to use exported functions as this issue describes?

https://github.com/angular/angular/issues/11262

ignaciolarranaga commented 7 years ago

I had, I modified it as suggested and get solved, but now getting this other error:

$ npm run start-ios-bundle

> gynto@1.1.7 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.7 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.7 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.7 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

  0% compilingfs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/registration/pages/registration/registration.html'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at WebpackResourceLoader.get (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/resource_loader.js:91:45)
    at DirectiveNormalizer._fetch (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:13896:45)
    at DirectiveNormalizer.normalizeTemplateAsync (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:13930:23)
    at DirectiveNormalizer.normalizeTemplate (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:13910:46)
    at CompileMetadataResolver._loadDirectiveMetadata (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:14471:60)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:14712:89
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12714:153
    at Array.map (native)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12714:122
    at Array.map (native)
    at loadNgModuleDirectives (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12714:46)
    at OfflineCompiler.compileModules (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12776:18)
    at CodeGenerator.codegen (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler-cli/src/codegen.js:58:30)
    at AotPlugin._make (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:193:43)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@ngtools/webpack/src/plugin.js:157:75)
    at Compiler.applyPluginsParallel (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:193:14)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:468:8
    at Compiler.applyPluginsAsyncSeries (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:95:46)
    at Compiler.compile (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:461:7)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:222:10
    at Compiler.readRecords (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:371:10)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:219:9
    at next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:102:11)
    at Compiler.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/CachePlugin.js:34:58)
    at Compiler.applyPluginsAsyncSeries (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:106:13)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compiler.js:216:8
    at next (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:102:11)
ignaciolarranaga commented 7 years ago

Solved the last problem moving back to use module.id (I had to stop using it because of webpack in the past :))

Now having this issue (I'm detailing the series of issues because it might help others):

$ npm run start-ios-bundle

> gynto@1.1.7 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.7 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.7 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.7 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

 10% building modules 3/4 modules 1 active ...de_modules/css-loader/lib/css-base.jsError: Template parse errors:
'Image' is not a known element:
1. If 'Image' is an Angular component, then verify that it is part of this module.
2. If 'Image' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("<GridLayout>
    <StackLayout class="connecting">
        [ERROR ->]<Image src="res://icon" class="icon"></Image>
        <ActivityIndicator [busy]="isLoading" [visibili"): RegistrationPage@2:8
Can't bind to 'busy' since it isn't a known property of 'ActivityIndicator'. ("lass="connecting">
        <Image src="res://icon" class="icon"></Image>
        <ActivityIndicator [ERROR ->][busy]="isLoading" [visibility]="isLoading ? 'visible' : 'collapse'" *ngIf="!dataLoaded" class="loade"): RegistrationPage@3:27
Can't bind to 'visibility' since it isn't a known property of 'ActivityIndicator'. ("        <Image src="res://icon" class="icon"></Image>
        <ActivityIndicator [busy]="isLoading" [ERROR ->][visibility]="isLoading ? 'visible' : 'collapse'" *ngIf="!dataLoaded" class="loader"></ActivityIndica"): RegistrationPage@3:46
'ActivityIndicator' is not a known element:
1. If 'ActivityIndicator' is an Angular component, then verify that it is part of this module.
2. If 'ActivityIndicator' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
    <StackLayout class="connecting">
        <Image src="res://icon" class="icon"></Image>
        [ERROR ->]<ActivityIndicator [busy]="isLoading" [visibility]="isLoading ? 'visible' : 'collapse'" *ngIf="!dataL"): RegistrationPage@3:8
Can't bind to 'text' since it isn't a known property of 'Label'. ("ng ? 'visible' : 'collapse'" *ngIf="!dataLoaded" class="loader"></ActivityIndicator>
        <Label [ERROR ->][text]="'registration.connecting' | translate" class="title"></Label>
        <Label [text]="'registr"): RegistrationPage@4:15
Can't bind to 'text' since it isn't a known property of 'Label'. ("        <Label [text]="'registration.connecting' | translate" class="title"></Label>
        <Label [ERROR ->][text]="'registration.connecting-description' | translate" textWrap="true" class="description"></Labe"): RegistrationPage@5:15
'StackLayout' is not a known element:
1. If 'StackLayout' is an Angular component, then verify that it is part of this module.
2. If 'StackLayout' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("<GridLayout>
    [ERROR ->]<StackLayout class="connecting">
        <Image src="res://icon" class="icon"></Image>
        <Activ"): RegistrationPage@1:4
'GridLayout' is not a known element:
1. If 'GridLayout' is an Angular component, then verify that it is part of this module.
2. If 'GridLayout' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<GridLayout>
    <StackLayout class="connecting">
        <Image src="res://icon" class="icon"></Imag"): RegistrationPage@0:0
    at TemplateParser.parse (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:7730:21)
    at OfflineCompiler._compileComponent (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12864:53)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12808:115
    at Array.forEach (native)
    at OfflineCompiler._compileSrcFile (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12792:22)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12777:76
    at Array.map (native)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/@angular/compiler/bundles/compiler.umd.js:12777:41
ignaciolarranaga commented 7 years ago

Solved the last by adding:

import { NgModule, ..., NO_ERRORS_SCHEMA } from "@angular/core";

@NgModule({
    schemas: [ NO_ERRORS_SCHEMA ],

to all the modules.

Now running into this issue (I tried "use strict" without success):

$ npm run start-ios-bundle

> gynto@1.1.7 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.7 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.7 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.7 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

 94% asset optimization GenerateBundleStarterPlugin: /Users/ignacio/Workspaces/Gynto/gynto-client/app
Hash: 0c01524f430d7e2b3bce
Version: webpack 2.1.0-beta.27
Time: 7726ms
       Asset       Size  Chunks             Chunk Names
  app.css.js  262 bytes       0  [emitted]  app.css
   bundle.js    3.47 kB       1  [emitted]  bundle
   vendor.js    7.74 kB       2  [emitted]  vendor
     app.css     2.9 kB       0  [emitted]  app.css
package.json   25 bytes          [emitted]  
  starter.js   41 bytes          [emitted]  
    + 4 hidden modules

WARNING in ./app.css
  resolve-url-loader cannot operate: CSS error
  /Users/ignacio/Workspaces/Gynto/gynto-client/app/app.css:6:63: property missing ':'
  at error (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/css/lib/parse/index.js:62:15)

WARNING in ./app.css
  resolve-url-loader cannot operate: CSS error
  /Users/ignacio/Workspaces/Gynto/gynto-client/app/app.css:6:63: property missing ':'
  at error (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/css/lib/parse/index.js:62:15)

ERROR in ./main.ts
Module build failed: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at loadLoader (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:160:10)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:168:18
    at loadLoader (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
    at runLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:357:2)
    at NormalModule.doBuild (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModule.js:131:2)
    at NormalModule.build (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModule.js:179:15)
    at Compilation.buildModule (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:127:9)
    at Compilation.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:404:8)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:74:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:160:70)
    at onDoneResolving (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:49:11)
    at onDoneResolving (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:165:6)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:161:6
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:3694:9
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:356:16
    at iteratorCallback (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:936:13)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:840:16
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:3691:13
    at apply (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:21:25)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:56:12

ERROR in ./vendor.ts
Module build failed: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at loadLoader (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:160:10)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:168:18
    at loadLoader (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:164:2)
    at runLoaders (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/loader-runner/lib/LoaderRunner.js:357:2)
    at NormalModule.doBuild (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModule.js:131:2)
    at NormalModule.build (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModule.js:179:15)
    at Compilation.buildModule (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:127:9)
    at Compilation.<anonymous> (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/Compilation.js:404:8)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:74:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/tapable/lib/Tapable.js:160:70)
    at onDoneResolving (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:49:11)
    at onDoneResolving (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:165:6)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/lib/NormalModuleFactory.js:161:6
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:3694:9
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:356:16
    at iteratorCallback (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:936:13)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:840:16
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:3691:13
    at apply (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:21:25)
    at /Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/webpack/node_modules/async/dist/async.js:56:12
Child app/pages/registration/registration.html:
        + 1 hidden modules
...
hdeshev commented 7 years ago

Thanks for describing those issues in detail. I think we're stuck with the module.id and the NO_ERRORS_SCHEMA hacks for the time being.

Closing this one in favor of #32 where we discuss the strict mode error.

ignaciolarranaga commented 7 years ago

Hey sorry, placed the comment in the wrong thread.

It was the node version, I just upgraded and the last error disappeared, but now having another one. It seems not to recognize the plugins:

npm run start-ios-bundle

> gynto@1.1.9 prestart-ios-bundle /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run webpack-ios

> gynto@1.1.9 prewebpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> npm run clean-ios

> gynto@1.1.9 clean-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> tns clean-app ios

> gynto@1.1.9 webpack-ios /Users/ignacio/Workspaces/Gynto/gynto-client
> webpack --config=webpack.ios.js --progress

 94% asset optimization GenerateBundleStarterPlugin: /Users/ignacio/Workspaces/Gynto/gynto-client/app
Hash: 28b70bc1d95f571d2c74
Version: webpack 2.1.0-beta.27
Time: 38913ms
       Asset       Size  Chunks             Chunk Names
       14.js    1.57 MB      14  [emitted]  
        0.js    1.88 MB       0  [emitted]  
        2.js    2.16 MB       2  [emitted]  
        3.js    1.92 MB       3  [emitted]  
        4.js    1.98 MB       4  [emitted]  
        5.js    1.74 MB       5  [emitted]  
        6.js     1.9 MB       6  [emitted]  
        7.js    1.77 MB       7  [emitted]  
        8.js     1.7 MB       8  [emitted]  
        9.js    1.61 MB       9  [emitted]  
       10.js    1.66 MB      10  [emitted]  
       11.js    1.59 MB      11  [emitted]  
       12.js     1.6 MB      12  [emitted]  
       13.js     1.6 MB      13  [emitted]  
        1.js    1.78 MB       1  [emitted]  
       15.js    1.41 MB      15  [emitted]  
       16.js     762 kB      16  [emitted]  
       17.js     856 kB      17  [emitted]  
       18.js     260 kB      18  [emitted]  
       19.js     198 kB      19  [emitted]  
       20.js     198 kB      20  [emitted]  
       21.js     179 kB      21  [emitted]  
       22.js     146 kB      22  [emitted]  
   bundle.js    1.63 MB      23  [emitted]  bundle
  app.css.js  267 bytes      24  [emitted]  app.css
   vendor.js    3.23 MB      25  [emitted]  vendor
     app.css     2.9 kB      24  [emitted]  app.css
package.json   25 bytes          [emitted]  
  starter.js   41 bytes          [emitted]  
 [276] .. async 160 bytes {25} [built]
    + 1227 hidden modules

WARNING in ./app.css
  resolve-url-loader cannot operate: CSS error
  /Users/ignacio/Workspaces/Gynto/gynto-client/app/app.css:6:63: property missing ':'
  at error (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/css/lib/parse/index.js:62:15)

WARNING in ./app.css
  resolve-url-loader cannot operate: CSS error
  /Users/ignacio/Workspaces/Gynto/gynto-client/app/app.css:6:63: property missing ':'
  at error (/Users/ignacio/Workspaces/Gynto/gynto-client/node_modules/css/lib/parse/index.js:62:15)

ERROR in ./pages/user-addresses/user-addresses.component.ts
Module not found: Error: Can't resolve 'nativescript-google-maps-sdk' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/user-addresses'
 @ ./pages/user-addresses/user-addresses.component.ts 6:11-50
 @ ./pages/user-addresses/user-addresses.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./pages/company/company.component.ts
Module not found: Error: Can't resolve 'nativescript-permissions' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/company'
 @ ./pages/company/company.component.ts 9:18-53
 @ ./pages/company/company.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./pages/company-products/product-editor/product-editor.component.ts
Module not found: Error: Can't resolve 'nativescript-permissions' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/company-products/product-editor'
 @ ./pages/company-products/product-editor/product-editor.component.ts 6:18-53
 @ ./pages/company-products/company-products.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./pages/company-products/product-editor/product-editor.component.ts
Module not found: Error: Can't resolve 'nativescript-imagepicker' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/company-products/product-editor'
 @ ./pages/company-products/product-editor/product-editor.component.ts 7:24-59
 @ ./pages/company-products/company-products.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./pages/company-features/company-features.component.ts
Module not found: Error: Can't resolve 'nativescript-purchase' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/company-features'
 @ ./pages/company-features/company-features.component.ts 6:0-50
 @ ./pages/company-features/company-features.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./pages/company-features/company-features.component.ts
Module not found: Error: Can't resolve 'nativescript-purchase/transaction' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/pages/company-features'
 @ ./pages/company-features/company-features.component.ts 7:0-69
 @ ./pages/company-features/company-features.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts

ERROR in ./shared/services/image.service.ts
Module not found: Error: Can't resolve 'nativescript-background-http' in '/Users/ignacio/Workspaces/Gynto/gynto-client/app/shared/services'
 @ ./shared/services/image.service.ts 1:13-52
 @ ./pages/company/company.component.ngfactory.ts
 @ ./pages/company/company.module.ngfactory.ts
 @ .. async
 @ ../~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
 @ ../~/@angular/core/src/linker.js
 @ ../~/@angular/core/src/core.js
 @ ../~/@angular/core/index.js
 @ ./main.ts