Next.js Discord

Discord Forum

TSConfig Paths in Production

Unanswered
Mini Rex posted this in #help-forum
Open in Discord
Mini RexOP
I am running a turbo/pnpm monorepo with some nextjs apps. Files imported using that path directive are not being resolved, only on production builds in vercel. This entirely works on local development (Tested on both MacOS and WSL2). The error is (Module not found: Can't resolve '~/styles/globals.css')
TSConfig (tsconfig.json):
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": ["src/*"]
    },
    "strictNullChecks": true
  },


File (src/app/layout.tsx):
import '~/styles/globals.css';
...

0 Replies