Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Ionic's rc.1 tries to compile typings and tests folder #173

Closed
patrickbussmann opened this issue Oct 15, 2016 · 9 comments
Closed

Ionic's rc.1 tries to compile typings and tests folder #173

patrickbussmann opened this issue Oct 15, 2016 · 9 comments
Assignees
Labels

Comments

@patrickbussmann
Copy link

Short description of the problem:

This is my current log if I start ionic serve.
The problem is that ionic tries to compile the typings folder. Or it tries to include this folder to the build process so that much typing are duplicated.
The same for the tests. For the tests I'm using jasmine so ionic shouldn't care about missing it or describe functions. But ionic care about... :-(

What behavior are you expecting?

That the tests and typings folders are ignored during the compile process of ionic serve. 👍

Steps to reproduce:

  1. Create tests folder or install typings with tsd https://github.com/DefinitelyTyped/tsd
  2. Try to compile your project

Which @ionic/app-scripts version are you using?
+-- @ionic/app-scripts@0.0.34

Log:

C:\xampp\htdocs>ionic serve -a --nobrowser

Running 'serve:before' npm script before serve

> htdocs@1.0.0 watch C:\xampp\htdocs
> ionic-app-scripts watch

[13:24:53]  ionic-app-scripts 0.0.34
[13:24:53]  watch started ...
[13:24:53]  build dev started ...
[13:24:53]  clean started ...
[13:24:53]  clean finished in 7 ms
[13:24:53]  copy started ...
[13:24:53]  transpile started ...
[13:24:54]  lint started ...
[13:24:57]  lint finished in 3.75 s
[13:24:59]  typescript: ...xampp/htdocs/node_modules/typescript/lib/lib.es2015.iterable.d.ts, 
            line: 141 
            Duplicate identifier 'Promise'.

     L140:      race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;
     L141:  [13:24:59]  typescript: .../xampp/htdocs/node_modules/typescript/lib/lib.es2015.promise.d.ts, }


            line: 20 
            Duplicate identifier 'Promise'.

      L19:  * Attaches callbacks [13:24:59]  typescript: .../xampp/htdocs/node_modules/typescript/lib/lib.es2015.promise.d.ts, for
 the resolution and/or rejection of the Promise.
            line: 187       L20:
* @param[13:24:59]  typescript: ...docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, 
             line: 164 o
nfulfilled The callback to execute when the Promise is resolved.
      L21:  * @returns A Promise for the completion of which ever callback is executed.

[13:24:59]  typescript: .../htdocs/src/pages/2order/+cart/shared/cart-indicator.component.ts,             Duplicate identifier 'Promise'. 

            Duplicate identifier 'Promise'. 


     L163:              line: 51 * Replaces text 
in a string, using this regular expression.
     L164:  * @para[13:24:59]  typescript: C:/xampp/htdocs/src/pages/2order/+order/order.component.ts, line: m
            6  
string A String object or string literal whose contents matching against
     L165:  *               [13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 3 this
 regular expression will be replaced

            Argument of type '{ type: string; }' is not assignable to parameter of type 'Scheduler |
            { type: string; totalCount: number; }'. Type '{ type: string; }' is not assignable to type
            '{ type: string; totalCount: number; }'. Property 'totalCount' is missing in type '{ type:
            string; }'.

      L50:  [13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 7 .distinctUntilChanged()

      L51:  .startWith({type: 'in[13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 7 i
t'})
      L52:  [13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 9 .subscribe(data => {

            Module '"C:/xampp/htdocs/src/pages/2order/shared/index"' has no exported member 
            'Product'. 


       L5:  import {CartComponent, CartService} from '../+cart/index';
       L6:  import {P[13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 10 
roduc[13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 14 
t} from '../shared/index';
       L7:  [13:24:59]  typescript: C:/xampp/htdocs/test/intro_spec.ts, line: 14 
import {CustomProductPage} from '../custom-product/custom-product';

            Cannot find name 'browser'.

[13:24:59]  typescript: C:/xampp/htdocs/typings/es6-promise/es6-promise.d.ts, line: 11 
       L2:  [13:24:59]  typescript: C:/xampp/htdocs/typings/es6-promise/es6-promise.d.ts, line: 42 beforeEach(() => {

       L3:    browser.get('');
[13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 9        L4:
});

            Cannot find name 'element'.

       L6:  it('should have multiple pages', () => {
[13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 11        L7:
  expect([13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 13 e
lement.all(by.css('.header-intro')).count()).toBe(1);

            Cannot find name 'by'.

       L6:  it('should have multiple pages', () => {
[13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 14        L7:  
  expect(element.all(by.css('.header-intro')).count()).toBe(1);

            Cannot find name 'by'.

       L9:  let buttonSelectorOnward = b[13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 17 
y.buttonText('Weiter');
      L10:  expect(element.all(buttonSelectorOnward).count()).toBe(1);

            Cannot find name 'element'. 

       L9:  let buttonSelectorOnward = by.buttonText('Weiter');
      L10:  expect(element.all(buttonSelectorOnward).count()).toBe(1);

            Cannot find name 'element'. 

      L13:  // {
      L14:    let buttonOnward = element(by.buttonText('Weiter'));
      L15:    buttonOnward.click();

            Cannot find name 'by'. 

      L13:  // {
      L14:    let buttonOnward = element(by[13:24:59]  typescript: C:/xampp/htdocs/typings/jasmine/jasmine.d.ts, line: 18 .buttonText('Weiter'));

      L15:    buttonOnward.click();

            Duplicate identifier 'Promise'.

      L10:  * If you call reject your promise is rejected with the object passed to reject.
[13:24:59]  typescript: C:/xampp/htdocs/typings/mocha/mocha.d.ts, line: 33       L11:
* For consistency[13:24:59]  typescript: C:/xampp/htdocs/typings/mocha/mocha.d.ts, line: 34
and debugging (eg stack traces), obj should be an instanceof Error.
      L12:  [13:24:59]  typescript: C:/xampp/htdocs/typings/mocha/mocha.d.ts, line: 39 * Any errors thrown 
in the constructor callback will be implicitly passed to reject().

            Duplicate identifier 'Promise'.

      L42:  [13:24:59]  typescript: C:/xampp/htdocs/typings/mocha/mocha.d.ts, line: 40 
function resolve<T>(value?: T | Thenable<T>): Promise<T>;

            Duplicate identifier 'describe'.

       L8:  declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?:
       L9:  declare function xit(expectation: string, assertion?: () => void, timeout?: number): voi
      L10:  declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?:

            Duplicate identifier 'xdescribe'.

            Duplicate identifier 'it'.

      L12:  /** If you call the function pending anywhere in the spec body, no matter the expectati
      L13:  declare function pending(reason?: string): void;

            Duplicate identifier 'it'.

            Duplicate identifier 'xit'.

      L16:  declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void;
      L17:  declare function afterEach(action: () => void, timeout?: number): void;
      L18:  declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void;

            Duplicate identifier 'xit'.

      L17:  declare function afterEach(action: () => void, timeout?: number): void;
      L18:  declare function aft[13:24:59]  transpile failed erEach(action: (done: DoneFn) => void, timeout?: number): void;

            Duplicate identifier 'describe'. 


      L32:  // alias for `describe`
      L33:  declare var suite: Mocha.IContextDefinition;
      L34:  declare var it: Mocha.ITestDefinition;

            Duplicate identifier 'xdescribe'.

      L33:  declare var suite: Mocha.IContextDefinition;
      L34:  declare var it: Mocha.ITestDefinition;
      L35:  declare var xit: Mocha.ITestDefinition;

            Duplicate identifier 'it'.

            Duplicate identifier 'xit'.

      L40:  interface MochaDone {
      L41:      (error?: any): any;

[13:24:59]  copy finished in 5.82 s
[13:24:59]  watch ready in 5.97 s
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit
@danielehrhardt
Copy link

Same Problem here!!

@adamdbradley
Copy link
Contributor

tsd has been deprecated in favor of typings. Would you be able to try https://github.com/typings/typings instead?

For more info: DefinitelyTyped/tsd#269

@danbucholtz
Copy link
Contributor

The best route to take is to use @types instead of the Typings tool. That is what we will support going forward as we deprecated support for typings with Typescript 2.0.

There are two things we can do:

  1. Add a types entry to the tsconfig.json for jasmine
  • or -
  1. Use the include option in tsconfig.json to specify what files are to be used. We could exclude spec files, etc.

We'll figure this out soon.

Thanks,
Dan

@jgw96
Copy link
Contributor

jgw96 commented Oct 21, 2016

@danbucholtz Couldn't we use the excludes option to ignore spec files?

@danbucholtz
Copy link
Contributor

@jgw96, probably.

Thanks,
Dan

jgw96 added a commit to ionic-team/ionic2-app-base that referenced this issue Oct 21, 2016
@jgw96 jgw96 removed the needs_reply label Oct 21, 2016
@jgw96
Copy link
Contributor

jgw96 commented Oct 21, 2016

@patrickbussmann can you add the line i added in my above commit to your tsconfig and give that a try? Thanks!

@derksacklowski
Copy link

derksacklowski commented Oct 24, 2016

adding "**/*.spec.ts" sound reasonable but isn't working for me

@maxkunitsa
Copy link

maxkunitsa commented Oct 26, 2016

I have similar problem, here is what i see in terminal:

...
L19358: export = matchesProperty;
Duplicate identifier 'export='.
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19358
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19364

L19363: const memoize: typeof _.memoize;
L19364: export = memoize;
Duplicate identifier 'export='.
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19370

L19369: const merge: typeof _.merge;
L19370: export = merge;
Duplicate identifier 'export='.
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19376

L19375: const mergeWith: typeof _.mergeWith;
L19376: export = mergeWith;
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19382

        Duplicate identifier 'export='. 

L19381: const method: typeof _.method;
L19382: export = method;
Duplicate identifier 'export='.
[19:10:34] typescript: node_modules/@types/lodash/index.d.ts, line: 19388
... etc

@jgw96 jgw96 added bug and removed needs_reply labels Oct 31, 2016
@danbucholtz
Copy link
Contributor

This is fixed now. Please make sure your tsconfig.json file matches the one we provide.

Thanks,
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants