cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

How to clear "web unsupported syntax" issue in solution checker?

The below mentioned is the error that I am facing for HTML Web resource which contains java script in it.

 

         ->I am trying to export my solution so ,before exporting the solution I need to run the solution by using solution checker in the power apps. So I have run my solution in that so I got this error.

 

 

"Unable to understand the syntax of this file. We currently do not support ECMA standards greater than version 5. We may have also encountered a true syntax error in the file. Please use a code editor that performs JavaScript validation, such as Visual Studio Code, to identify the script error locations. Note that other rules were unable to run on this file so the results are likely incomplete."

  • Moreover I have validated the code using visual studio and It is error free.
  • I have even removed the ES 6 version code and made it to ES 5 (for fetch).

could some please help me in clearing this issue.

 

Thanks in advance

Thanks,

Yamini

1 ACCEPTED SOLUTION

Accepted Solutions
Solution Sage
Solution Sage

When I had that problem I hunted for an es5 validator to see if it could highlight the actual problem and it turned out I had a couple of let rather than var commands.

 

https://www.piliapp.com/javascript-validator/ was the tool I ended up using, just paste your code in and it should show you where the issues are.

 

 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

15 REPLIES 15
Power Apps
Power Apps

Apologies that you are encountering this issue. Does it provide you with a line number or anything that can help you zoom into what the specific syntax would be? The line number is relative to the script that is embedded and not the HTML file's line numbers. The tool generally assumes that if there is a syntax error of any kind or anything that our parser does not understand that it is an ECMA 6 problem. We are trying to fully move to another parser which will possibly clear this up for you, but that is taking time and we don't have an ETA yet. Usually, if there is some issues in parsing out the embedded JavaScript, the script has some tag building logic using concatenation that throws off the parser. Do you have any logic like that? If you find that is the case you could run it without that logic and address any issues and then put it back. You could also move any embedded JavaScript out to a js file. Usually, that is the better approach anyway and it may get you past this issue.

 

If you are able to submit a support ticket with the file, then we can troubleshoot further.

Solution Sage
Solution Sage

When I had that problem I hunted for an es5 validator to see if it could highlight the actual problem and it turned out I had a couple of let rather than var commands.

 

https://www.piliapp.com/javascript-validator/ was the tool I ended up using, just paste your code in and it should show you where the issues are.

 

 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

Hi ,

Thank you this helped me in clearing the issues.

 

Regards,

Surineni Yamini

Hi ,

This is the error I am getting for HTML web resource :

 

'parent.Xrm.Page' references or accesses a deprecated API in the client context object model. Replace this call with the following client context API: 'ExecutionContext.getFormContext'

 

So can you please suggest me how to use ExecutionContext in HTML web resource.

Thanks,

Surineni Yamini

 

https://docs.microsoft.com/en-us/power-platform/important-changes-coming seems to have been silently updated and it now says that parent.Xrm is on the list to be deprecated where previously support was continuing.

 

https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/... shows how to access the information nowadays. But note there is a possible race condition where you may call the function before the page is loaded - the open bug has setinterval code which will resolve that but you will need to replace the let s with var s to get past the validation checker.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Hi  @ben-thompson 

I wasn't aware that we have to use getContentWindow. I know about the deprecation of Xrm.Page and about the deprecation of ClientGlobalContext.js.aspx., and that the getContentWindow is a possibility (which I didn't took as reasonable, because this means that I have to include a form-script for each HTMLWebResource on the form).

 

But in the link about the deprecation 😞https://docs.microsoft.com/en-us/power-platform/important-changes-coming#some-client-apis-are-deprec...) is stated

- about deprecation of Xrm.Page: 

"Although Xrm.Page is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource."

 

- about the deprecation of parent.Xrm

"Use one of the following:
a) Use a custom control created using Power Apps component framework instead of HTML web resources.
b) On forms, use the getContentWindow method of the web resource control.
c) If the getContentWindow method doesn't work, you can use parent.Xrm to get to the Xrm object inside an HTML web resource. If the HTML web resource is opened in a new window then you should use opener.Xrm instead."

 

So we can use parent.Xrm, but in that case we cannot pass the solution checker and the solution cannot get the certification?

Best regards,

Diana

Are you talking about AppSource certification? The certification team is aware of false positives for some rules, including with this rule. Static analysis is not perfect.

Are you using AppSource checker?

Hi ,

I have cleared those errors and I passed my solution checker.

 

Thanks,

Yamini

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Users online (11,837)