#Import error in NPM workspaces

1 messages · Page 1 of 1 (latest)

mild cipher
#

Hello, I'm trying to configure a monorepo with npm workspaces, and under my "express-js" package, whenever I try to import the express module, it tries to import it from packages/express-js/index.ts, what's even weirder is that if I rename my package to something else, say "packages/server", the error immediately goes away but comes back when reinstalling my node modules, does anybody know what's going on?

quasi ferry
#

Yeah, seems like there's something weird with your setup, I don't know why it'd be looking there for "express" instead of node_modules. What's in your tsconfig? Is there some path mapping logic?

mild cipher
#

Nope, no path mapping

{
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": ".",
    "strict": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "module": "commonjs",
    "target": "ES6"
  }
}
mild cipher
#

Turns out I named my package "express"...

#

im an idiot 😂