0

I want to start coding with Tabris.js, and try to get some experience with the playground. But every example which uses async function asyncFunctionName(...) doesn't start. The error message is:

Could not load main module: Error: Could not parse ./app.js:./app.js:7:
SyntaxError: Unexpected token function
async function showActionSheet() {
      ^^^^^^^^
com.eclipsesource.v8.V8ScriptCompilationException
at subscribe (./cordova.js:758:11)
at addEventListener (./cordova.js:133:34)
at _entryPoint (./cordova.js:1560:18)

The simple examples like hello.js work well. The shipped examples in the tabris developer app work well. What am I doing wrong?

1 Answers1

0

Comparing the output of what the Playground generates to what's inside the app they are definitely different. Tabris.js on Android does not yet support the async/await syntax natively (but iOS does).

This looks like a bug in implementation of the Playground, so it'd be worthwhile to open an issue for that. In the meantime, you can also clone the repo and run the snippets using the instructions included in the snippets directory:

npm install -g tabris-cli
git clone https://github.com/eclipsesource/tabris-js
cd tabris-js/snippets
tabris serve -m dist/actionsheet.jsx
Cookie Guru
  • 397
  • 2
  • 10