Accessing Backend Module

Hi Guys, I created a Backend module called aModule.jws and imported that in my front end code. However, after previewing my code to test it, I see this in the console:

Cannot find module ‘Backend/aModule.jsw’ in ‘public/pages/u9mzr.js’

I imported the function from my backend code like so:
import {backend} from ‘Backend/aModule.jsw’;

Thanks in advance!
A.

import {backend} from 'Backend/aModule.jsw'; 

Should be 'from ‘backend/…’ and not ‘from Backend/…’

Plus {backend} should be your function name and not just backend.

See this page for more info:
Wix Code: Calling Server-Side Code from the Front-End with Web Modules

Check your permissions too:
Wix Code: About Web Module Permissions

Hi,thanknthankns for your reply.
Sorry about the confusion. My function is called backend. I was testing and chose that name for some strange reason.

Additionally, I am not sure what you mean by this:
Should be 'from ‘backend/…’ and not ‘from Backend/…’

Thanks !

@ayubadan18

Backend should be changed from this:

import {backend} from 'Backend/aModule.jsw';

Should be like this:

import {backend} from 'backend/aModule.jsw';

@givemeawhisky thank you very much, it did solve my problem :slight_smile: