argonjs / argon-app

Source code for the Argon4 AR Web Browser

Home Page:https://app.argonjs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile from source

bitseer opened this issue · comments

Hello.

I'm attempting to compile from newly cloned source and am receiving the following error messages.

Executing before-prepare hook from /Users/brian/projects/argon-app/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.1
app/components/common/argon-vuforia-provider.ts(432,52): error TS2345: Argument of type 'Promise<string | undefined>' is not assignable to parameter of type 'Promise<string>'.
  Type 'string | undefined' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.

plugins/argon-web-view/argon-web-view-common.ts(7,23): error TS2420: Class 'ArgonWebView' incorrectly implements interface 'ArgonWebView'.
  Types of property 'on' are incompatible.
    Type '{ (eventNames: string, callback: (data: EventData) => void, thisArg?: any): any; (event: "loadFin...' is not assignable to type '{ (event: "session", callback: (args: SessionEventData) => void, thisArg?: any): any; (event: str...'.
      Types of parameters 'callback' and 'callback' are incompatible.
        Types of parameters 'args' and 'data' are incompatible.
          Type 'EventData' is not assignable to type 'SessionEventData'.
            Property 'session' is missing in type 'EventData'.

TypeScript compiler failed with exit code 1

My system setup is:

  • MacOS 10.11.6
  • XCode 8.2.1
  • Nativescript 3.1.0

I am able to build and run other Nativescript applications (both ios and android).

Here are the steps I took and the results:

git clone git@github.com:argonjs/argon-app.git

cd argon-app

tns install

> @argonjs/argon@1.3.6 postinstall /Users/brian/projects/argon-app/node_modules/@argonjs/argon
> npm install types/cesium types/mobile-detect

@argonjs/argon@1.3.6 /Users/brian/projects/argon-app/node_modules/@argonjs/argon
├── @types/cesium@1.0.0
└── @types/mobile-detect@1.3.2


> nativescript-dev-typescript@0.3.7 postinstall /Users/brian/projects/argon-app/node_modules/nativescript-dev-typescript
> node postinstall.js

Project already targets TypeScript ^2.1.4

> nativescript-hook-debug-production@1.0.4 postinstall /Users/brian/projects/argon-app/node_modules/nativescript-hook-debug-production
> node postinstall.js

/Users/brian/projects/argon-app
├─┬ @argonjs/argon@1.3.6
│ └─┬ aurelia-dependency-injection@1.3.1
│   ├── aurelia-metadata@1.0.3
│   └── aurelia-pal@1.3.0
├── @types/minimatch@2.0.29
├─┬ @types/urijs@1.15.33
│ └── @types/jquery@3.2.9
├── argon-web-view@1.0.0
├─┬ babel-traverse@6.15.0
│ ├─┬ babel-code-frame@6.22.0
│ │ ├─┬ chalk@1.1.3
│ │ │ ├── ansi-styles@2.2.1
│ │ │ ├── escape-string-regexp@1.0.5
│ │ │ ├─┬ has-ansi@2.0.0
│ │ │ │ └── ansi-regex@2.1.1
│ │ │ ├── strip-ansi@3.0.1
│ │ │ └── supports-color@2.0.0
│ │ └── js-tokens@3.0.2
│ ├── babel-messages@6.23.0
│ ├─┬ babel-runtime@6.23.0
│ │ ├── core-js@2.4.1
│ │ └── regenerator-runtime@0.10.5
│ ├─┬ debug@2.6.8
│ │ └── ms@2.0.0
│ ├── globals@8.18.0
│ ├─┬ invariant@2.2.2
│ │ └── loose-envify@1.3.1
│ └── lodash@4.17.4
├─┬ babel-types@6.15.0
│ ├── esutils@2.0.2
│ └── to-fast-properties@1.0.3
├── babylon@6.9.2
├── lazy@1.0.11
├─┬ minimatch@3.0.4
│ └─┬ brace-expansion@1.1.8
│   ├── balanced-match@1.0.0
│   └── concat-map@0.0.1
├─┬ nativescript-dev-typescript@0.3.7
│ └─┬ nativescript-hook@0.2.1
│   ├─┬ glob@6.0.4
│   │ ├─┬ inflight@1.0.6
│   │ │ └── wrappy@1.0.2
│   │ ├── inherits@2.0.3
│   │ ├── once@1.4.0
│   │ └── path-is-absolute@1.0.1
│   └─┬ mkdirp@0.5.1
│     └── minimist@0.0.8
├── nativescript-google-analytics@0.3.7
├── nativescript-hook-debug-production@1.0.4
├── nativescript-permissions@1.2.3
├── nativescript-screen-orientation@1.0.1  (git://github.com/argonjs/nativescript-screen-orientation.git#922b552fe9c710a6dd991a348988715f625fb3d1)
├── nativescript-vuforia@1.0.0
├── speigg-nativescript-geolocation@0.0.9-patch.0
├─┬ UNMET PEER DEPENDENCY tns-core-modules@2.5.3
│ └── tns-core-modules-widgets@2.5.0
├── tns-platform-declarations@2.5.3
├── typescript@2.4.1
└── urijs@1.18.10

npm WARN nativescript-google-analytics@0.3.7 requires a peer of tns-core-modules@^3.0.0 but none was installed.
npm WARN argon-app No repository field.
npm WARN argon-app No license field.
Copying template files...
Installing  tns-ios
/Users/brian/projects/argon-app
├── UNMET PEER DEPENDENCY tns-core-modules@2.5.3
└── tns-ios@2.5.0

Project successfully created.
Copying template files...
Installing  tns-android
/Users/brian/projects/argon-app
├── tns-android@2.5.0
└── UNMET PEER DEPENDENCY tns-core-modules@2.5.3

Project successfully created.

Please note that there are three occurrences of UNMET PEER DEPENDENCY tns-core-modules@2.5.3 in that portion of the transcript. (Not sure if they are relevant here or not.)

tns prepare ios

Executing before-prepare hook from /Users/brian/projects/argon-app/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.1
app/components/common/argon-vuforia-provider.ts(432,52): error TS2345: Argument of type 'Promise<string | undefined>' is not assignable to parameter of type 'Promise<string>'.
  Type 'string | undefined' is not assignable to type 'string'.
    Type 'undefined' is not assignable to type 'string'.

plugins/argon-web-view/argon-web-view-common.ts(7,23): error TS2420: Class 'ArgonWebView' incorrectly implements interface 'ArgonWebView'.
  Types of property 'on' are incompatible.
    Type '{ (eventNames: string, callback: (data: EventData) => void, thisArg?: any): any; (event: "loadFin...' is not assignable to type '{ (event: "session", callback: (args: SessionEventData) => void, thisArg?: any): any; (event: str...'.
      Types of parameters 'callback' and 'callback' are incompatible.
        Types of parameters 'args' and 'data' are incompatible.
          Type 'EventData' is not assignable to type 'SessionEventData'.
            Property 'session' is missing in type 'EventData'.

TypeScript compiler failed with exit code 1

Editing line 432 of alskjdfl from:
const sessionData = new VuforiaSessionData(keyPromise);
to
const sessionData = new VuforiaSessionData(keyPromise as Promise<string>);

eliminates the first error. I'm not sure what to do about the second. Please let me know what I need to do and how I can help.

Thanks for the detailed issue! Which branch are you building?

master

I believe these problems are fixed in develop. Can you try that? Make sure you delete node_modules, platforms, and the app from your phone before building again.

That solved it. Thank you!