# Cannot read property 'api' of undefined  - Shopware.Context.api

**URL:** <https://forum.shopware.com/t/cannot-read-property-api-of-undefined-shopware-context-api/64053>\
**Category:** Programming (EN)\
**Created:** [16. Januar 2020 um 14:56 UTC](https://forum.shopware.com/t/cannot-read-property-api-of-undefined-shopware-context-api/64053 "2020-01-16T14:56:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michal\_bnet](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@michal\_bnet](https://forum.shopware.com/u/michal_bnet)\
**Post date:** [16. Januar 2020 um 14:56 UTC](https://forum.shopware.com/t/cannot-read-property-api-of-undefined-shopware-context-api/64053/1 "2020-01-16T14:56:52Z")

</div>

hi following this example plugin

[https://github.com/shopware/swag-docs-bundle-example](https://github.com/shopware/swag-docs-bundle-example)

in file

[swag-docs-bundle-example](https://github.com/shopware/swag-docs-bundle-example)/[src](https://github.com/shopware/swag-docs-bundle-example/tree/master/src)/[Resources](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources)/[app](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app)/[administration](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration)/[src](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration/src)/[module](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration/src/module)/[swag-bundle](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration/src/module/swag-bundle)/[page](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration/src/module/swag-bundle/page)/[swag-bundle-list](https://github.com/shopware/swag-docs-bundle-example/tree/master/src/Resources/app/administration/src/module/swag-bundle/page/swag-bundle-list)/ **index.js**

&nbsp;

i am getting error in console&nbsp;

Cannot read property ‚api‘ of undefined

it is coming from&nbsp;Shopware.Context.api

how can i solve this ?

&nbsp;

created() {  
this.repository = this.repositoryFactory.create(‚swag\_bundle‘);

this.repository  
.search(new Criteria(), Shopware.Context.api)  
.then((result) =\> {  
this.bundles = result;  
});  
}
