when I follow the guide creating router pages, an exception occurred when using `WixRouterSitemapEntry` I got errors :
import { ok, notFound, WixRouterSitemapEntry } from "wix-router";
'WixRouterSitemapEntry' is declared but its value is never read.
however, when I change to `wixRouterSitemapEntry` I got errors :
import { ok, notFound, wixRouterSitemapEntry } from "wix-router";
export function myRouter_SiteMap(sitemapRequest){
...
let entry = new wixRouterSitemapEntry(domain);
}
This expression is not constructable. Type 'WixRouterSitemapEntry' has no construct signatures.
In preview mode 's console all Dynamic Pages , got error below, and return 502 pages after published /user-code/backend/routers.js: Duplicate declaration "entry"
So, how to use WixRouterSitemapEntry?
Is it my wrong? If this is not a bug, why can't I find a similar question?
You can look at Example: Stripe Payment Processing to see WixRouterSitemapEntry being used on the routers.js page.
The import statement should be (taken from the example):
import {ok, redirect, WixRouterSitemapEntry, next} from 'wix-router';
WixRouterSitemapEntry is being incorrectly flagged as an error, but it works. I'm going to check into this issue.
Creating an instance is done this way (also from the example):
let entry = new WixRouterSitemapEntry(page);
I hope this helps.