This is a migrated thread and some comments may be shown as answers.

telerikReportViewer - "SyntaxError: Unexpected token :"

1 Answer 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 21 Aug 2017, 06:59 PM

I am creating a reporting site that is an Angular app housed within MVC 5. When I try to instantiate the telerikReportViewer, it gives me the following error:

SyntaxError: Unexpected token :
at start (VM825 telerikReportViewer.js:4539)
at ZoneDelegate.invoke (zone.js:391)    
at Object.onInvoke (ng_zone.ts:261)    
at ZoneDelegate.invoke (zone.js:390)    
at Zone.run (zone.js:141)    
at zone.js:818    
at ZoneDelegate.invokeTask (zone.js:424)    
at Object.onInvokeTask (ng_zone.ts:253)    
at ZoneDelegate.invokeTask (zone.js:423)    
at Zone.runTask (zone.js:191)

On line 4539 of telerikReportViewer.js, it throws the error on the 9th index of 'scripts'. While debugging, 'scripts' was displayed as such:

(11) ["", "", "", "", "System.import('../src/main.js').catch(function (err) { console.error(err); });", "", "", "", "var params = {↵            AuthToken: $("#AuthToke…    };↵↵        GlobalHeaderFooter.setup(params);", "{"appName":"Chrome","requestId":"f51b2a9f21e04898972e2e5463503faa"}", ""]
0:""
1:""
2:""
3:""
4:"System.import('../src/main.js').catch(function (err) { console.error(err); });"
5:""
6:""
7:""
8:"var params = {↵            AuthToken: $("#AuthToken").val(),↵            CurrentProjectId: $("#CurrentProjectId").val(),↵            CurrentServiceId: ($("#CurrentServiceId").val() == "") ? null : $("#CurrentServiceId").val(),↵            HelpUrl: "https://communities.bentley.com/communities/other_communities/sign-in_assistance_and_web_services/",↵            SignOutUrl: $("#SignOutUrl").val(),↵            LegalUrl: "https://dev-webportal-eus.cloudapp.net" + "/Legal"↵        };↵↵        GlobalHeaderFooter.setup(params);"
9:"{"appName":"Chrome","requestId":"f51b2a9f21e04898972e2e5463503faa"}"
10:""
length:11

 

I'm not sure what the problem is. It is saying that there is an unexpected colon, but line 9 seems to be normal. I believe this is a cause for my viewer to not show up on the page, but I'm not sure. 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 23 Aug 2017, 12:40 PM
Hi Justin,

This is not a known issue. I have tested to run Angular Viewer demo projects (installed on your machine under [Telerik Reporting installation folder]\Telerik\Reporting [version]\Examples\Angular) and could display the reports successfully.

The error message indicates that the JavaScript syntax is not valid. In order to provide you more accurate suggestions we would need to debug a sample project that reproduces this error.

You can attach it in a support ticket that you opened for the same issue - #1126536.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Justin
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or