A required parameter was not provided as a string in getStaticPaths next.js even I test in another file and the typeof(val.args.campaignAddress) was string How could I fix this.
export async function getStaticPaths() {
const provider = new ethers.providers.JsonRpcProvider(process.env.NEXT_PUBLIC_RPC_URL);
const contract = new ethers.Contract(process.env.NEXT_PUBLIC_ADDRESS , CampaignFactory.abi, provider);
const getDeployedCampaign = contract.filters.campaignCreated();
let events = await contract.queryFilter(getDeployedCampaign);
return {
paths: events.map((val) => ({
params: {
address: val.args.campaignAddress.toString(),
}
})),
fallback: "blocking",
}
}