refinedev/refine

[BUG] finefoods-client Sample is broken

Closed this issue · 2 comments

Describe the bug

Getting this error from nextjs-router packages when visiting localhost:3000

Error: Cannot find module '/workspace/node_modules/next/router' imported from /workspace/node_modules/@refinedev/nextjs-router/dist/pages.mjs
Did you mean to import next/router.js?

Steps To Reproduce

  1. Create a new refine project from sample: npm create refine-app@latest -- --example finefoods-client
  2. cd finefoods-client
  3. npm run dev

Expected behavior

The routing should work as expected and the default page (root route) should be displayed on the browser

Packages

"dependencies": {
"@refinedev/cli": "^2.16.29",
"@refinedev/core": "^4.49.0",
"@refinedev/nextjs-router": "^6.0.2",
"@refinedev/react-table": "^5.6.8",
"@refinedev/simple-rest": "^5.0.4",
"@tanstack/react-table": "^8.2.6",
"gsap": "^3.8.0",
"js-confetti": "^0.9.0",
"next": "^14.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/node": "^18.16.2",
"@types/react": "^18.0.0",
"autoprefixer": "^10.4.1",
"postcss": "^8.1.4",
"tailwindcss": "^3.0.11",
"typescript": "^5.4.2"
}

Additional Context

It's a fresh installation no custom code has been added.

you can see the error even in codesandbox:
codesandbox

it's working when I downgraded @refinedev/nextjs-router to 6.0.1

"@refinedev/nextjs-router": "=6.0.1",

Hey @kainio sorry for the issue! Same issue is also discussed at #5831, I've opened up two PRs to fix this issue 🙏