npm link libraries cant be used by nextjs
Answered
Grand Griffon Vendéen posted this in #help-forum
Grand Griffon VendéenOP
I have a small library of mine included to the nextjs project via npm link and somehow i get this error:
Module not found: Can't resolve 'my-lib'
i added the library like this:
and if i run
The issue seems to be resolved if i import it by copying the files directly
Module not found: Can't resolve 'my-lib'
1 | import { account, user } from "my-lib"; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i added the library like this:
npm i ../../path-to/package/my-lib
and if i run
The issue seems to be resolved if i import it by copying the files directly
Answered by Grand Griffon Vendéen
1 Reply
Grand Griffon VendéenOP
Answer