sek-consulting / solid-ui

Beautifully designed components. Built with Kobalte & corvu. Styled with Tailwind CSS.
https://www.solid-ui.com
MIT License
680 stars 25 forks source link

cannot configure tsconfig.json #34

Closed seongs1024 closed 8 months ago

seongs1024 commented 8 months ago

when I initialize a project with npx solidui-cli@latest init, then got error like:

Something went wrong while configuring your tsconfig.json
file:///.npm/_npx/ee21f74023e4584f/node_modules/solidui-cli/dist/index.js:823
    if (!tsconfigData.compilerOptions.paths) {
                      ^

TypeError: Cannot read properties of null (reading 'compilerOptions')
    at file:///.npm/_npx/ee21f74023e4584f/node_modules/solidui-cli/dist/index.js:823:23
    at file:///.npm/_npx/ee21f74023e4584f/node_modules/solidui-cli/dist/index.js:591:7
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)

mytsconfig.json is like:

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "module": "ESNext",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve",
    "jsxImportSource": "solid-js",

    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true,

    "baseUrl": ".",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }

  },
  "include": ["src"],
  "references": [{ "path": "./tsconfig.node.json" }]
}

Environment

package manager: pnpm
Node.js: v20.9.0
sek-consulting commented 8 months ago

Thank you for the info. Also with the given tsconfig.json I can replicate the issue so I should be able to look into the issue when I have some free time later today. 😁

seongs1024 commented 8 months ago

Always appreciate that your blazing fast comments and fixes!

sek-consulting commented 8 months ago

As quick in between update: The problem occurs since .json files don't officially support comments. So if you remove both comments it works like a charm.

For how to solve the issue we're not sure yet.

seongs1024 commented 8 months ago

Thank you!