0

I go to url http://local:3000/customize/collection/doremon1234a/schema/dfs/template/50

enter image description here

Enven I provide [colName - doremon1234a], [schemaName - dfs], [templateId - 50] But it still gets errors

I try to remove .next folder, and clone source code again. But it does not work Anyone gets the same issue like me. Thanks THis is my folder structure enter image description here

my source code

import { useRouter } from "next/router";
import React, { useState, useEffect } from "react";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useTranslation } from "next-i18next";
import { i18n } from "@/config";

function TemplateId() {
const { t } = useTranslation("common");
const router = useRouter();
const { colName, schemaName,  templateId } = router.query;

return (
    <>
        <div>{templateId}</div>
    </>
);
}

export async function getServerSideProps({ locale }) {
try {
    const translations = await serverSideTranslations(locale, ["common"], {
        i18n,
    });

    return {
        props: {
            ...translations,
        },
    };
} catch (error) {
    console.log("TemplateId: ", error);
}
}

export default TemplateId;
sun1211
  • 1,219
  • 10
  • 15
  • The problem is not in the path to the page, it's most likely an issue with a `Link`'s `href` you have in that page. Can you provide the code for the `customize/collection/[colName]/schema/[schemaName]/template/[templateId]/index.tsx` page? – juliomalves Jan 09 '22 at 14:53
  • My code is very simple @juliomalves – sun1211 Jan 09 '22 at 15:12
  • What's the `Container` component? Can you show the code for that as well? Also, do you have any links that link to that template page in your app? – juliomalves Jan 09 '22 at 15:15
  • I removed all source code, just keep skeleton, But it does not work @juliomalves, I think it is not from the code – sun1211 Jan 09 '22 at 15:26
  • Could you provide a [mre], or a repo where the issue is reproducible? – juliomalves Jan 10 '22 at 12:58

0 Answers0