79385904

Date: 2025-01-24 23:40:01
Score: 1.5
Natty:
Report link

Not using Vite or ts but https://stackoverflow.com/a/76989526/29355805 above got me on the right track! (i cant comment or upvote yet on here)

I moved some stuff around manually and somehow it FINALLY started working. Thought i'd share incase if anyone else is on an even more similar boat.

jsconfig.json--

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["**/*.js", "**/*.jsx", "tailwind.config.js"],
  "exclude": ["node_modules"]
}

then add a component-- npx shadcn add then created a lib directory in ./src/components, and manually dropped the utils.js file in.

then added alias: { "@": path.resolve(__dirname, "../../src/components"), } inside webpack.config.js

const path = require("path");

const options = {
  resolve: {
    extensions: [".css", ".scss", ".ts", ".tsx"],
    alias: {
      "@": path.resolve(__dirname, "../../src/components"),
    },
  },

i restarted servers, loaded a button in, and it worked! 🎉 good luck to the next person!🤞

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Blacklisted phrase (0.5): upvote
  • Whitelisted phrase (-1): it worked
  • RegEx Blacklisted phrase (1): cant comment
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Robyn