NathanWalker / nativescript-ngx-plugin-seed

Get started building NativeScript + Angular plugins quickly.
MIT License
43 stars 11 forks source link

error TS2318: Cannot find global type 'Array' #11

Closed rezacute closed 7 years ago

rezacute commented 7 years ago

Hi @NathanWalker ,

I follow README and get the error whenever run npm run demo.ios thanks.

error TS2318: Cannot find global type 'Array'.

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.

error TS2318: Cannot find global type 'RegExp'.

error TS2318: Cannot find global type 'String'.

12   public options: Array<any> = [
                     ~~~~~

src/app/components/yourplugin.component.ts(12,19): error TS4031: Public property 'options' of exported class has or is using private name 'Array'.

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.8.1
npm ERR! npm  v3.10.8
NathanWalker commented 7 years ago

Make sure you have {N} 2.4.0:

Check with: tns --version If you don't have at least that version, npm i -g nativescript

Then try doing this:

git stash
git pull
rm -rf node_modules src/node_modules src/hooks src/lib src/platforms
npm run setup

The last setup step there is important. Then and only then, try:

npm run demo.ios
rezacute commented 7 years ago

still the same. i did fresh git clone. My tns version 2.4.2 FYI i am able to run your other repo https://github.com/NathanWalker/angular-seed-advanced , so i don't think there is any problem on my configuration.

fyi, if i add "es6" on tsconfig.json then the error is cahanged to :


2 import { Page } from "ui/page";
                       ~~~~~~~~~

node_modules/nativescript-angular/directives/action-bar.d.ts(2,22): error TS2307: Cannot find module 'ui/page'.

2 import { ListView } from "ui/list-view";
                           ~~~~~~~~~~~~~~

node_modules/nativescript-angular/directives/list-view-comp.d.ts(2,26): error TS2307: Cannot find module 'ui/list-view'.

1 import { Device } from "platform";
                         ~~~~~~~~~~

thanks.

lukashlobil commented 7 years ago

I have the same issue on ng2-fonticon plugin

I checked on multiple machines, it seems like it is not my configuration.

If I change to es6, the eror remains the same.

NathanWalker commented 7 years ago

I will update this seed over weekend (or sooner). Regarding fonticon plugin, note new name: nativescript-ngx-fonticon v2.0.0: https://github.com/NathanWalker/nativescript-ngx-fonticon

NathanWalker commented 7 years ago

Hi @rezacute @lukashlobil I have updated this seed's dependencies to solve the issue here. Also note, the repo has been renamed to: nativescript-ngx-plugin-seed. Please let me know if you have any further issue.