Hi,

I'm trying to use a simple javascript share function that uses the native web-share api on mobile devices.

However when i try to paste the javascript code i get this error:


I found an old topic that told me to use :

/*jshint esversion: 6 */

However that still does not let me publish, the errors are gone in the javascript window. How can i use this function in reactive web apps?


Hello Bas,

As far as I know, ES6 is still not supported in OutSystems: https://www.outsystems.com/forums/discussion/30128/p10-how-to-resolve-javascript-warnings-jshint-esversion-6/

This answer was for version 10, but I think it still applies to version 11 as well.

Cheers.

Eduardo Jauch wrote:

Hello Bas,

As far as I know, ES6 is still not supported in OutSystems: https://www.outsystems.com/forums/discussion/30128/p10-how-to-resolve-javascript-warnings-jshint-esversion-6/

This answer was for version 10, but I think it still applies to version 11 as well.

Cheers.

Thanks for the reply, kind of strange since it is available since 2015 already and a widespread JS standard. 

Is there no workaround available to this? (Like loading an external JS file?)

Hi, I will ask around, but I don't think so.

Cheers.

Bas,

Try changing the 'const' to 'var', like this:


var shareBtn = document.querySelector('.share-btn');


Kind regards,

Stuart

Hi guys,


I have solved it by using the https://babeljs.io/ JS converter. 


Thanks for the replies!

Hello Bas.

Just to add, I was informed that if you extract your JavaScript to a file instead of a node, it should work.

Cheers.

Hi guys,

I already use const and the hint tag /*jshint esversion:6 */ in mobile and reactive apps and it is working. See below that my Module was published properly. 


Fabio,


I tried that, but the 1 click publish still says that the JavaScript contains errors even though it solved it all.


Eduardo, I will try that tomorrow.

Bas de Jong wrote:

Hi guys,


I have solved it by using the https://babeljs.io/ JS converter. 


Thanks for the replies!

This is a great solution.  Thank you


Bas de Jong wrote:

Eduardo Jauch wrote:

Hello Bas,

As far as I know, ES6 is still not supported in OutSystems: https://www.outsystems.com/forums/discussion/30128/p10-how-to-resolve-javascript-warnings-jshint-esversion-6/

This answer was for version 10, but I think it still applies to version 11 as well.

Cheers.

Thanks for the reply, kind of strange since it is available since 2015 already and a widespread JS standard. 

Is there no workaround available to this? (Like loading an external JS file?)

You can always use babel js to convert your es6 code into es5 code then import it