-1

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.