Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagination-service.d.ts error TS1005: Build:'=' expected #81

Closed
alejandrocoding opened this issue Oct 12, 2016 · 21 comments
Closed

pagination-service.d.ts error TS1005: Build:'=' expected #81

alejandrocoding opened this issue Oct 12, 2016 · 21 comments
Assignees

Comments

@alejandrocoding
Copy link

Hi there,

I am having troubles with the typings of the library, I've been looking for the typings in the typing source but they are not there, they are in the dist folder.

So, if I am running the project by node, there is not problem, but when I am running up with Visual Studio. I get 2 errors:

.....\UI\node_modules\ng2-pagination\dist\pagination-service.d.ts(30,14): error TS1005: Build:'=' expected.

......\UI\node_modules\ng2-pagination\dist\pagination-service.d.ts(30,23): error TS1005: Build:';' expected.

I tried to include the typings on the bootstrap file unsuccessfully. Any idea? Thanks!

@michaelbromley
Copy link
Owner

Hi,

What version of Angular and this library are you using?

@ghost
Copy link

ghost commented Oct 17, 2016

Hi,

I have the same problem, and same error messages.

I use Angular 2.0.1 and ng2-pagination 0.5.1.

@alejandrocoding
Copy link
Author

Sorry, couldn't reply before, same versions from here. I fixed downgrading the version of ng2-pagination.

@ghost
Copy link

ghost commented Oct 17, 2016

Thanks @ialex90. That worked for me too.

@Sk421
Copy link

Sk421 commented Oct 17, 2016

Hi,
I have same issue.
Can you please tell me Downgrade to which version?

@ghost
Copy link

ghost commented Oct 17, 2016

Hi,

Version 0.4.1 worked for me.

@Sk421
Copy link

Sk421 commented Oct 17, 2016

Thanks LasseBurn.

Now the problem is I am getting ' http://localhost:3000/ng2-pagination 404 (Not Found)' error.

@alejandrocoding
Copy link
Author

alejandrocoding commented Oct 17, 2016

@Sk421 You are importing the components instead the module, that's wrong. Have a look here:
#79 (comment)

@Sk421
Copy link

Sk421 commented Oct 17, 2016

Thanks for your reply @ialex90
Now I am doing this "import { Ng2PaginationModule } from 'ng2-pagination';".
But getting error.

@alejandrocoding
Copy link
Author

@Sk421 please, provide more info about the error, paste it here and the code for the ngmodule too.

@Sk421
Copy link

Sk421 commented Oct 17, 2016

App.module.ts file

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { Ng2PaginationModule } from 'ng2-pagination';

@NgModule({

imports: [
BrowserModule, Ng2PaginationModule],

declarations: [
AppComponent
],
providers:[],

bootstrap: [ AppComponent ]
})
export class AppModule {
}

Error:
zone.js:1274 GET http://localhost:3000/ng2-pagination 404 (Not Found)scheduleTask @ zone.js:1274ZoneDelegate.scheduleTask @ zone.js:216Zone.scheduleMacroTask @ zone.js:153(anonymous function) @ zone.js:1304send @ VM1834:3fetchTextFromURL @ system.src.js:1051(anonymous function) @ system.src.js:1781ZoneAwarePromise @ zone.js:478(anonymous function) @ system.src.js:1780(anonymous function) @ system.src.js:2809(anonymous function) @ system.src.js:3387(anonymous function) @ system.src.js:3701(anonymous function) @ system.src.js:4093(anonymous function) @ system.src.js:4556(anonymous function) @ system.src.js:4825(anonymous function) @ system.src.js:407ZoneDelegate.invoke @ zone.js:203Zone.run @ zone.js:96(anonymous function) @ zone.js:462ZoneDelegate.invokeTask @ zone.js:236Zone.runTask @ zone.js:136drainMicroTaskQueue @ zone.js:368ZoneTask.invoke @ zone.js:308
(index):19 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/ng2-pagination(…)(anonymous function) @ (index):19ZoneDelegate.invoke @ zone.js:203Zone.run @ zone.js:96(anonymous function) @ zone.js:462ZoneDelegate.invokeTask @ zone.js:236Zone.runTask @ zone.js:136drainMicroTaskQueue @ zone.js:368ZoneTask.invoke @ zone.js:308

@Sk421
Copy link

Sk421 commented Oct 17, 2016

Thanks for your replies @ialex90 and @LasseBrun .

I have solved the problem. I added a script file in index.html.

@alejandrocoding
Copy link
Author

@Sk421 Happy to help even this wasn't the best place for that. Let's not forget the subject of the problem,
So, any news about the issue?

@michaelbromley
Copy link
Owner

Hi. Great to see people stepping in to help one another, thanks 👍🏼

Re the original issue, I'll have time later this week to look into it. Is everyone here using systemjs?

@ghost
Copy link

ghost commented Oct 17, 2016

Hi,

Yes, I'am using systemjs.

@alejandrocoding
Copy link
Author

@michaelbromley me too, thanks :)

@alejandrocoding
Copy link
Author

I have the feeling that this problem could be solved with the latest version of Typescript, and that just happen in lower than TS 2.0.x, Can you check if that works for you @LasseBrun ?

@ghost
Copy link

ghost commented Oct 18, 2016

I use TS 2.0.3. But it might be something wrong with my gulp-typescript. I'll take a closer look at it tomorrow!

@michaelbromley
Copy link
Owner

@ialex90 The line that your original error points to is:

    readonly defaultId: string;

This suggests to me that the error is due to the fact that this lib is now built with TypeScript 2.x, and perhaps your version of TypeScript is older and does not understand the readonly keyword, which is new.

Check into that.

@alejandrocoding
Copy link
Author

@michaelbromley this might be helpful:

ng-bootstrap/ng-bootstrap#904 (comment)

:)

@michaelbromley michaelbromley self-assigned this Oct 25, 2016
@michaelbromley
Copy link
Owner

@ialex90 Thanks, that's good info. So in the next release I will make it compatible with TS 1.8+. 👍

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

No branches or pull requests

3 participants