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

Online build not working with decorators #83

Open
jumpjack opened this issue Apr 26, 2022 · 1 comment
Open

Online build not working with decorators #83

jumpjack opened this issue Apr 26, 2022 · 1 comment

Comments

@jumpjack
Copy link

I wrote a script which use decorators (ItemPicker), and it works fine in android playground; it also compiles fine to .apk and installs properly; app starts... but it immediately stops, complaining about not being able to find tabris-decorators module.

I have these imports at the beginning of my script:

const {Button, TextView, contentView, Stack, TextInput, AlertDialog, NavigationView, Page, Action, drawer, Composite, CollectionView, ScrollView, Row} = require('tabris');
const {ItemPicker, List} = require('tabris-decorators');

As I said, it works fine in playground.
I tried several combinations/variants of package.json , with no success.

@jumpjack
Copy link
Author

Ok I found the solution, I need to explicitly add decorators in package.json:

{
  "name": "listview-cells",
  "version": "3.5.0",
  "dependencies": {
    "reflect-metadata": "^0.1.13",
    "tabris": "^3.8.0",
    "tabris-decorators": "3.7.0"
  },
  "main": "src/app.js",
  "scripts": {
    "start": "tabris serve -w -a",
    "gitpod": "tabris serve -a -w --no-intro --port 8080 --external $(gp url 8080):443"
  }
}

Partial demo (missing Cordova configuration):

https://github.com/eclipsesource/tabris-decorators/tree/v3.8.0/examples/itempicker-js

Maybe it would be useful to mention it in documentation:

https://docs.tabris.com/latest/api/ItemPicker.html

https://docs.tabris.com/latest/di/index.html#the-decorators

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

No branches or pull requests

1 participant