I need to work with a local package with my next.JS project. To avoid publishing on npm every time :
- On the next.js project: npm i ../test-sample-api. I can now see on my package.json the line : "test-sample-api": "1.0.0" .
In node_modules, Ihave my link to the correct package (and the build in dist...)
I can import it : import {HelloWorld} from "test-sample-api", and the autocompletion is ok.
But when i start my next an error is raise :
Module not found: Can't resolve 'test-sample-api'
> 1 | const { HelloWorld } = require("test-sample-api");
or
Module not found: Can't resolve 'test-sample-api'
> 1 | import { HelloWorld } from "test-sample-api";
I really thought it was working, but apparently I must be doing something wrong.