0

I've been trying to add tailwind to my full stack app where I am playing around with socket.io. However, in setting it up I get this error in tailwind.config.js and postcss.config.js which blocks tailwind from working.

When copying over my tsconfig.json into a repo which is just the client and not server folder this export is recognised, suggesting to me that this is an issue with an automatic import looking in the wrong path when there are multiple folders that contain tsconfig.json files?

Getting this error in tailwind.config.js

client/tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "baseUrl": "client",
    "paths": {
      "@/components/*": ["client/components/*"],
      "@/containers/*": ["client/containers/*"],
      "@/pages/*": ["client/pages/*"],
      "@/types": ["client/types"]
    },
    "typeRoots": ["client/node_modules/@types"],
    "types": ["node"]
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

The full repo - https://github.com/puyanwei/socketio-chat-app

Things I have done to try and resolve this issue;

  1. Deleted node_modules and package.lock/yarn lock and reinstalled the packages with yarn and npm
  2. Changed baseUrl to /client and .
  3. Restarted VS Code
  4. Uninstalled and reinstalled node
  5. Added paths to typeRoots key/value pair in tsconfig.json
  6. Added "types: ["node"] to tsconfig.json
  7. Added @types/node to package.json but it doesn't seem to apply the types

Any help would be appreciated, thanks!

pyan
  • 865
  • 2
  • 12
  • 23
  • This seems to be what I'm looking for - https://stackoverflow.com/questions/37579969/how-to-use-multiple-tsconfig-files-in-vs-code – pyan Feb 08 '23 at 20:01

0 Answers0