-
Duplicate React Dependencies:
- The root project has React ^18 as a peer dependency
- The example folder also has React ^18 as a direct dependency
- Both projects are using Next.js, with the example using version ^15.1.3 and the root project also using ^15.1.3
-
Package Structure Issues:
- The root project is a UI component library that should have React as a peer dependency (which it correctly does)
- The example project should be using the root project as a dependency, but there's no local link setup visible
-
Update Example Project's package.json:
- Remove the direct Next.js dependency from the root project since it's a UI component library
- Update the example project to use a stable version of Next.js (version 15 is not a valid version - latest stable is 14.x)
- Add a local link to the root project in the example's dependencies
-
Required Changes:
In the root
package.json:- Remove "@types/next": "^9.0.0" - Remove "next": "^15.1.3"
In the example
package.json:{ "dependencies": { "next": "^14.2.13", "@nodegeeks/ui-components": "file:../", // ... other dependencies } } -
Setup Instructions:
- First, build the root project:
npm run build - In the example folder, run:
npm install - In the example folder, run:
npm link ../ - Start the development server:
npm run dev
- First, build the root project:
This should resolve the React-related compilation issues by ensuring proper dependency management and preventing duplicate React instances.