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

Compiling Error on Hosted Agent: Pagination typing #904

Closed
alejandrocoding opened this issue Oct 18, 2016 · 8 comments
Closed

Compiling Error on Hosted Agent: Pagination typing #904

alejandrocoding opened this issue Oct 18, 2016 · 8 comments

Comments

@alejandrocoding
Copy link

Hi there,

I have no problems with node, but on Visual Studio and on Hosted Agent I have it.

The error is this one:
..\@ng-bootstrap\ng-bootstrap\pagination\pagination.d.ts error TS1005: Build:'=' expected.

not sure what's the problem, with node is working, even I updated Typescript to 2.0.3 for Visual Studio and it works, but as the hosted agent of TFS just have the 1.8.x version, and we can't updoad, not sure if that could be the problem.

Anyone else having the same? Any work around or fix from the ng-bootstrap team?

Thanks!

@pkozlowski-opensource
Copy link
Member

Please provide complete error message as a bare minimum (line numbers). It is impossible to say anything based on just the info provided.

@alejandrocoding
Copy link
Author

alejandrocoding commented Oct 18, 2016

Hope this is enough for you @pkozlowski-opensource

C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "C:\xxxx\UI\tsconfig.json" UI\node_modules\@ng-bootstrap\ng-bootstrap\pagination\pagination.module.d.ts(2,31): Error TS2307: Build: Cannot find module './pagination'. node_modules\@ng-bootstrap\ng-bootstrap\pagination\pagination.module.d.ts(2,31): error TS2307: Build: Cannot find module './pagination'. [C:xxxx\UI\UI.xproj] Development\Source\SFA.UI\UI\node_modules\@ng-bootstrap\ng-bootstrap\popover\popover-config.d.ts(9,14): Error TS1112: Build: A class member cannot be declared optional. node_modules\@ng-bootstrap\ng-bootstrap\popover\popover-config.d.ts(9,14): error TS1112: Build: A class member cannot be declared optional. [C:xxxx\UI\UI.xproj] Development\Source\SFA.UI\UI\node_modules\@ng-bootstrap\ng-bootstrap\tooltip\tooltip-config.d.ts(9,14): Error TS1112: Build: A class member cannot be declared optional. node_modules\@ng-bootstrap\ng-bootstrap\tooltip\tooltip-config.d.ts(9,14): error TS1112: Build: A class member cannot be declared optional. [C:xxxx\UI\UI.xproj] Done Building Project "C:xxxx\UI\UI.xproj" (default targets) -- FAILED.

@pkozlowski-opensource
Copy link
Member

Errors related to popover-config and tooltip-config are due to TS version mismatch (we are using a feature from 2.0.x and your seem to be using an earlier version). The issue is here. I think that we could drop optionality from this field and restore compatibility with 1.8. Will discuss with the rest of the team.

Regarding errors for pagination - I'm not sure what is going on. I've got a suspect but that's it. Are you sure that you've copied & pasted the entire error log?

In any case the root of the problem is TS version mismatch.

@alejandrocoding
Copy link
Author

alejandrocoding commented Oct 18, 2016

I didn't find any advise of this dependency with TS 2.0.x in the doc, would be nice to add it.

In the hosted agent I can't upgrade the TS version, that's handle it by MS, as far as I know, is there any way to don't add the pagination from npm? Or any work around?

For tooltip and popover, keep us posted with the decision of the team, pls.

Thanks!

Ps: I'll check the error tmw again, if something is missing, I will update it here

@alejandrocoding
Copy link
Author

alejandrocoding commented Oct 19, 2016

@pkozlowski-opensource Actually I just checked it again, and the problem with Tooltip and popover are not related to the incompatibility of TS 1.8, they are compatible with that version, the problem was I deleted the pagination.d.ts to see if that would work and I got that error.

So, brief, the only issue with TS 1.8 and ng-bootstrap it's related to the pagination. This is the whole info I got from the hosted agent.

...xxx\@ng-bootstrap\ng-bootstrap\pagination\pagination.d.ts (52, 14)
...xxx\@ng-bootstrap\ng-bootstrap\pagination\pagination.d.ts(52,14): Error TS1005: Build: '=' expected.

...xxx\@ng-bootstrap\ng-bootstrap\pagination\pagination.d.ts (52, 23)
...xxx\@ng-bootstrap\ng-bootstrap\pagination\pagination.d.ts(52,23): Error TS1005: Build: ';' expected.

Process 'msbuild.exe' exited with code '1'.

If I run it locally with TS 2.x, it works, but with 1.8 it doesn't. I thought to delete the pagination folder but module file has dependencies on it, so we can't.

@pkozlowski-opensource
Copy link
Member

Thnx @ialex90 for the additional info. I think that we can easily restore TS 1.8 compatibility in the generated .d.ts files as there is nothing preventing us from doing so.

I will push a fix later today.

@pkozlowski-opensource
Copy link
Member

The root cause of the problem discussed here is in this TS 2.0 breaking change: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#getters-with-no-setters-are-automatically-inferred-to-be-readonly-properties

Files to be fixed:

After fixing the above we should create a minimal project based on TS 1.8 and test if there are no other issues.

@alejandrocoding
Copy link
Author

@pkozlowski-opensource that's a great news, thanks for the support, let us know please when you publish the fixed, waiting to publish the app, thanks! 👍

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

No branches or pull requests

2 participants