We have:
pages/[providerSlug]/index.ts
pages/account/index.ts
When we visit /account (with no query), this code in [providerSlug]/index.ts gets hit:
export const getServerSideProps = async (context) => {
console.dir(context)
}
outputs:
...
query: { providerSlug: 'null' },
resolvedUrl: '/null',
params: { providerSlug: 'null' },
Two questions:
- Why is
[providerSlug]/index.tsbeing hit? Shouldn't onlyaccount/index.tsbe hit? I tried addinggetServerSidePropstoaccount/index.tsas well (it doesn't have it), made no difference. - Where is resolvedUrl & query.providerSlug getting set? I cannot find how this is getting set but it must be in our code somewhere -- what gets hit before
getServerSidePropsthat I should look at?
thanks.