Can't import 'wix-media-backend'

Hi All

When I tried to use ’ import wixMedia from ‘wix-media-backend’;’
I found the message that the script could not be found as below.

Cannot find module ‘wix-media-backend’ in ‘public/pages/vbk3n.js’

Please let me know how to fix it.

Thanks

Where do you have that import statement? In which code file?

Note that you can only import wix-media-backend in a backend file.

I did import to dynamic page.

How do I get image file information from a dynamic page? In conclusion, I would like to know the ‘parentFolderId’ among image file information.

Thanks
Yong

You can add the code example from getFileInfo() into a web module in the backend. Then, you can call that function from your frontend code.

See the article Corvid Web Modules: Calling Server-Side Code from the Front-End .

As you told me, I am getting the same error even though I modified the source. What is the problem?

@shin2180 You have a spelling error in your import statement. This is what you want:

import {test} from 'backend/aModule';