primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Contributing: Unable to develop locally using instructions from `DEVELOPMENT.md`

Open zawasp opened this issue 1 year ago • 6 comments

Describe the bug

I followed all instructions from DEVELOPMENT.md but when I'm using the local library in my test project I get module-not-found errors:

image

Reproducer

https://github.com/primefaces/primereact/blob/master/DEVELOPMENT.md

PrimeReact version

10.5.0

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

all

Steps to reproduce the behavior

Follow all steps from DEVELOPMENT.md

Expected behavior

Test app is able to work with local version of primereact when using npm link and npm run dev:link

zawasp avatar Feb 08 '24 08:02 zawasp

Same as https://github.com/primefaces/primereact/issues/5648#issuecomment-1873025061

zawasp avatar Feb 08 '24 09:02 zawasp

@zawasp what OS are you using Linux or Windows?

@bweis any thoughts here you wrote the original instructions I wonder if something has changed and needs to be updated?

melloware avatar Feb 08 '24 12:02 melloware

It's Ubuntu under WSL2 and node 20

zawasp avatar Feb 08 '24 13:02 zawasp

For anyone trying to contribute, I found a workaround:

  • in a new nextjs app (could be react as well), I symlinked the components/lib folder from the primereact repo into app. Something like this (ran from the app folder in my nextjs app): ln -s /home/user/primereact/components/lib primereact

You need to adjust your imports a bit, e.g.: import { Button } from "./primereact/button/Button"; instead of import { Button } from "./primereact/button";

Note this is not ideal, but at least I can contribute.

zawasp avatar Feb 10 '24 08:02 zawasp

That is fantastic actually.

melloware avatar Feb 10 '24 12:02 melloware

@zawasp i wonder if you should add this to the MD file?

melloware avatar Feb 10 '24 13:02 melloware