I place this code in a page to redirect
import {redirect} from 'wix-router';
export function myRouter_Router(request) {
return redirect("external_url", "301"); }
but error shows on the console: Cannot find module 'wix-router' in 'public/pages/p9pk3.js'
I tried to call support but got no help at all. Does anyone know why this issue is happening when 'wix-router' is the module name in the corvid documentation as well as this copy being directly from a corvid tutorial article? I am getting very frustrated.
What "corvid tutorial article" are you referencing?
As state in the router API documentation:
The code for both routers and data binding router hooks is defined in the routers.js file that you set up in the Code Files' Backend section of the Corvid Sidebar.
If you want to redirect from a client page, you can use the wix-location.to() function