Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
6 replies
Scotty O

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/
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!
Was this page helpful?