79322740

Date: 2025-01-02 04:09:33
Score: 1
Natty:
Report link

The problem was happening because of turbopack.

I removed the turbopack https://github.com/psankar/test-next-js-lib/commit/a09d2b63d288914688483ec317d06d1667dcf2ae after which the import works fine and the code works.

diff --git a/nextjs/package.json b/nextjs/package.json
index adb86a4..bc15fe9 100644
--- a/nextjs/package.json
+++ b/nextjs/package.json
@@ -3,7 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "dev": "next dev --turbopack",
+    "dev": "next dev",
     "build": "next build",
     "start": "next start",
     "lint": "next lint"
Reasons:
  • Probably link only (1):
  • Contains signature (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: Sankar