#Remix doesn't recognize a local library (`npm link`)

1 messages · Page 1 of 1 (latest)

rapid crystal
#

So basically I've a local library (WIP) that has been configured to work locally via npm link (in fact the symlink exists in the node_modules folder, the problem is that once I run npm run dev remix doesn't recognize the library at all:

Error: Cannot find module '.......'

Any ideas on how to make it work?

#

Remix doesn't recognize a local library (npm link)

kind roost
#

I haven’t tried with the link but I’ve had success developing local modules with remix by installing them from their file path directly

rapid crystal
#

@kind roost yeah I generally avoid that b/c that stays in the package.json and you can commit it by accident.

So far adding this to the remix.config.js file worked out: serverDependenciesToBundle: "all", the mail problem is IDK if it's right or not but it allowed me to work with multiple local modules without having to modify my package.json file at all.

tropic laurel
#

I had this issue when developing a package for remix that was client only, I think I had to output both a client and server bundle for it to work and configure the client and server entry points in package.json

carmine crescent
#

wow I was trying to figure this out the past 2 days and they do mention it in the "Gotchas" section of their docs