Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.3 Expected string but received undefined #956

Closed
kobe-ra opened this issue Mar 26, 2024 · 4 comments · Fixed by #965
Closed

0.9.3 Expected string but received undefined #956

kobe-ra opened this issue Mar 26, 2024 · 4 comments · Fixed by #965
Labels
type: enhancement An improvement or enhancement to an existing feature

Comments

@kobe-ra
Copy link

kobe-ra commented Mar 26, 2024

Describe the bug

image
image

I cannot use the add command in version 0.9.3
error message:
Invalid type: Expected string but received undefined
Tested version 0.9.2, which works properly.

Reproduction

Use command npx shadcn-svelte@latest add accordion in Laravel-Inertia-Svelte project. No sveltekit, no typescript. If neccessary I'll create a new project with the same setup tomorrow.

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 20.06 GB / 31.92 GB
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.7.1 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (122.0.2365.92)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    bits-ui: ^0.16.0 => 0.16.0
    mode-watcher: ^0.2.1 => 0.2.1
    svelte: ^4.2.11 => 4.2.11
    svelte-radix: ^1.1.0 => 1.1.0
    svelte-sonner: ^0.3.17 => 0.3.17
    vaul-svelte: ^0.2.2 => 0.2.2

Severity

annoyance

@AdrianGonz97
Copy link
Collaborator

Thanks for raising the issue.

If neccessary I'll create a new project with the same setup tomorrow.

Please create the reproduction. It's easier for us to fix if we have a complete repro to work with, especially when it uses outside tech that we may not be familiar with!

@AdrianGonz97 AdrianGonz97 added the status: needs reproduction A reproduction is required to support the issue. label Mar 26, 2024
Copy link
Contributor

Please provide a reproduction.

More info

Why do I need to provide a reproduction?

This project is maintained by a very small team, and we simply don't have the bandwidth to investigate issues that we can't easily replicate. Reproductions enable us to fix issues faster and more efficiently. If you care about getting your issue resolved, providing a reproduction is the best way to do that.

I've provided a reproduction - what happens now?

Once a reproduction is provided, we'll remove the needs reproduction label and review the issue to determine how to resolve it. If we can confirm it's a bug, we'll label it as such and prioritize it based on its severity.

If needs reproduction labeled issues don't receive any activity (e.g., a comment with a reproduction link), they'll be closed. Feel free to comment with a reproduction at any time and the issue will be reopened.

How can I create a reproduction?

You can use this template to create a minimal reproduction. You can also link to a GitHub repository with the reproduction.

Please ensure that the reproduction is as minimal as possible. If there is a ton of custom logic in your reproduction, it is difficult to determine if the issue is with your code or with the library. The more minimal the reproduction, the more likely it is that we'll be able to assist.

You might also find these other articles interesting and/or helpful:

@kobe-ra
Copy link
Author

kobe-ra commented Mar 27, 2024

here is the example repo

i also wrote the readme. if you have any troubles running it i can help.

the js part resides in /resources/js

@AdrianGonz97 AdrianGonz97 removed the status: needs reproduction A reproduction is required to support the issue. label Mar 27, 2024
@AdrianGonz97
Copy link
Collaborator

@kobe-ra

Your jsconfig.json is missing path aliases in the reproduction, which is causing this issue (I'm not quite sure why it was working in previous versions in the first place either 🤔).

Configuring the following will fix your issue:

components.json

{
    "$schema": "https://shadcn-svelte.com/schema.json",
    "style": "new-york",
    "typescript": false,
    "tailwind": {
        "config": "tailwind.config.js",
        "css": "resources/css/app.pcss",
        "baseColor": "zinc"
    },
    "aliases": {
        "components": "@/components",
        "utils": "@/services/utils"
    }
}

jsconfig.json

{
    "compilerOptions": {
        "paths": {
            "@/*": ["./resources/js/*"]
        }
    }
}

However, the error presented in the issue should definitely be more descriptive. Invalid type: Expected string but received undefined is neither particularly meaningful, nor helpful. We'll keep this issue open until that's fixed.

Thank you!

@AdrianGonz97 AdrianGonz97 added the type: enhancement An improvement or enhancement to an existing feature label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement An improvement or enhancement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants