Cannot find module 'wix-users'

yesterday until now, when we import the ‘wix-users’ module to the routers or the router-page as " import wixUsers from ‘wix-users’ ", we always suffer the wix error from console:

Internal server error:Error: Cannot find module ‘wix-users’ at Function.Module._resolveFilename (module.js:469:15) at Function.resolveFilenameOptimized [as _resolveFilename] (node_modules/fast-boot/index.js:54:33) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) <…>

Beside that the when we use the wixLocation as " ", the error of " TypeError: n.trim is not a function " is appeared, I think there are some wix-code problems on these modules, please help us to tackle this problem as soon as possible so that we could build our website on time.

Thank you.

Hi!
I can’t reproduce this error. Can you share the link with the site? I feel like you place it somewhere in wrong place
No error in this case:

https://www.screencast.com/t/mD55bRrLi5F

Can you really use that module in a router? I dont think you can use that module inside a router.

Hi!

‘wix-users’ module it a Front End code module, therefore it is not available on Back end modules.
Can you please tell me more about the use case? Maybe I can offer some other solution or consult with my team mates about at new feature.

Liran.

@Liran Kurtz:

My team wants to get information of current user (logged-in user) on the back end to insert to database for later use. If we get the information of current user on the front-end and send it back to the back-end via API,…, then it could pose some risks (security risks) that someone could intercept and modify the param on the API. Please provide us solution on this circumstance.

@ Andreas Kviby:

I imported on back end module.

You can access the wix-users module in page code and from page code you can reach backend functions by importing back end modules and sending the user object from front end to backend. Possible?

@Andreas Kviby:

How we could send the user objet from front end to backend, please give us an example, we consider the security risk alot as I said, when submit user object to the server, an attacker could intercept and modify it.

Any update on this as this questions concerns me. We usually don’t allow fron-end to pass/handle user specific information to back-end. Seems like wix-users should be there in back-end as well.

https://www.wix.com/corvid/forum/corvid-tips-and-updates/api-update-additions-to-wix-users-backend

we have wix-users-backend now to access current user information at backend.