problem importing first npm package
I’m trying to import my first npm package and getting a “cannot find module” error, funnily, with it still working.
I put up a description and links up here, but I’m wondering if this forum is a better place to be seeking help?
https://www.reddit.com/r/nextjs/comments/14p9c00/importing_my_first_npm_module_fails_with_error/
reddit
r/nextjs - importing my first npm module fails with: Error: Cannot ...
0 votes and 0 comments so far on Reddit
Solution:Jump to solution
ok, got some help on IRC to figure it out. If I change the main fom cjs to esm it appears to work. Don't really understand it (is it because I'm exporting named objects?) but it works!
4 Replies
What line? I don't see tx.locations.update?
damn wrong post my bad 😄
All good, thx. You got me very excited for a moment!
Solution
ok, got some help on IRC to figure it out. If I change the main fom cjs to esm it appears to work. Don't really understand it (is it because I'm exporting named objects?) but it works!