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

TypeError: Cannot read property 'config' of undefined #9

Open
runnerpaul opened this issue Jun 24, 2019 · 1 comment
Open

TypeError: Cannot read property 'config' of undefined #9

runnerpaul opened this issue Jun 24, 2019 · 1 comment

Comments

@runnerpaul
Copy link

runnerpaul commented Jun 24, 2019

I've created a query

const customerProducts = await knex.select([
      'CustomerProduct.id',
      'CustomerProduct.last_delivered AS lastDelivered',
      'CustomerProduct.customer_id AS customerId',
      'product.id',
      'product.title',
      'product.code',
    ])
    .from('customer_products AS CustomerProduct')
    .innerJoin('products AS product', 'CustomerProduct.product_id', 'product.id')
    .where(whereClause)
    .limit(limit)
    .offset(offset);

    knexnest(customerProducts).then(function (data) {
      result = data;
    });
return result;

When I try to execute this code I get this error:

TypeError: Cannot read property 'config' of undefined

I'm not sure why I should get it though.

@alitinker
Copy link

I ran into this. Don't await the knex.select. Await the knexnest promise instead.

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

2 participants