Skip to content

Errors while using Example Applauncher #331

Answered by Aylur
InKeaton asked this question in Q&A
Discussion options

You must be logged in to vote

I'm guessing your ags version is a bit out of date. In javascript class methods are not bound to instances, but in 1.7.5 they were converted into fat arrow functions

// pre 1.7.5, query function loses its `this` context
const { query } = await Service.import('applications')

// solve this by
const apps = await Service.import('applications')
const query = apps.query.bind(apps)

or update ags

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@InKeaton
Comment options

@Aylur
Comment options

@InKeaton
Comment options

Answer selected by InKeaton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants