# Cannot find module 'wix-stores-backend' in 'public/pages/spp7g.js'

**URL:** <https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989>\
**Category:** Ask the community\
**Tags:** wix-stores, question, code\
**Created:** [March 25, 2020, 9:33am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989 "2020-03-25T09:33:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://forum.wixstudio.com/u/dimitar)\
**Post date:** [March 25, 2020, 9:33am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989/1 "2020-03-25T09:33:25Z")

</div>

When trying to implement this code:

> import wixStoresBackend from ‘wix-stores-backend’

> export function getCurrentCart() {

> return wixStoresBackend.getCurrentCart();

> }  
> I am getting this error:  
> **Cannot find module ‘wix-stores-backend’ in ‘public/pages/spp7g.js’**

I have no idea why? The website is a Store one and I do not have created this file **wix-stores-backend, but I am assuming I do not need to** [**regarding this doc.**](https://www.wix.com/corvid/reference/wix-stores-backend.html#Cart)  
So what is my mistake?

---

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://forum.wixstudio.com/u/dimitar)\
**Post date:** [March 25, 2020, 9:41am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989/2 "2020-03-25T09:41:24Z")

</div>

I need to create a backend file and paste this code there and now it is working

---

<div class="post-metadata">

**Author:** ![anastasiias](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anastasiias/32/15771_2.png) [@anastasiias](https://forum.wixstudio.com/u/anastasiias)\
**Post date:** [March 25, 2020, 9:45am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989/3 "2020-03-25T09:45:21Z")

</div>

Hey,

I assume you are trying to use this code in your [Code Panel](https://support.wix.com/en/article/corvid-working-in-the-code-panel) and this way you will see errors when previewing your site.

As it’s stated in the API, the wix-stores-backend module contains functionality for working with your site’s store from backend code.

---

<div class="post-metadata">

**Author:** ![nicholaspijpers](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nicholaspijpers/32/780_2.png) [@nicholaspijpers](https://forum.wixstudio.com/u/nicholaspijpers)\
**Post date:** [March 25, 2020, 9:56am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989/4 "2020-03-25T09:56:31Z")

</div>

Had same issue with wix-users-backend. Can’t use backend modules in your client-side code.  
I’m not familiar with wixStores… But you use ‘wix-stores’ in front end.  
And if you need functions from wix-stores-backend. Create a .jsw file. Write your function. And import it client side like so:

backend:  
file.jsw

```javascript
import wixStoresBackend from 'wix-stores-backend'

export function someFunction(){
    console.log('NiNiNi')
}

```

client-side:

```javascript
import { someFunction } from 'backend/file'

$w.onReady(()=>{
    someFunction()
})

```

---

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://forum.wixstudio.com/u/dimitar)\
**Post date:** [March 25, 2020, 10:27am UTC](https://forum.wixstudio.com/t/cannot-find-module-wix-stores-backend-in-public-pages-spp7g-js/29989/5 "2020-03-25T10:27:46Z")

</div>

thanks
