sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.4k stars 4.1k forks source link

Component not defined #13180

Open Arashm-2009 opened 1 week ago

Arashm-2009 commented 1 week ago

Describe the bug

I was trying to use ts in my components with svelte 5 but it doesn't work and is says Button (my component) is not defined. When I stripped my project of ts, it was working.

Reproduction

https://replit.com/@arashmahipal/Svelte-Bug?v=1

Code for page.svelte (doesn't show when I open the link)

<Dashboard content={"Hello"} />

Logs

No response

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1
    Memory: 145.47 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
    npm: 10.8.3 - ~/.nvm/versions/node/v20.16.0/bin/npm
  Browsers:
    Safari: 17.2.1
  npmPackages:
    svelte: ^5.0.0-next.1 => 5.0.0-next.244

Severity

blocking an upgrade

paoloricciuti commented 1 week ago

I can't access the reproduction...can you please create the same on https://sveltelab.dev or https://stackblitz.com ?

Arashm-2009 commented 1 week ago

https://stackblitz.com/edit/sveltejs-kit-template-default-anxbmg?file=src%2Flib%2FButton.svelte

I don't know how to change the project to svelte 5 but I just did the same syntax as I would. What the error I would get is that Button is not defined. IN svelte 4 this is not a problem. It begins working again when ts is stripped out of my components

On Tue, 10 Sept 2024 at 03:13, Paolo Ricciuti @.***> wrote:

I can't access the reproduction...can you please create the same on https://sveltelab.dev or https://stackblitz.com ?

— Reply to this email directly, view it on GitHub https://github.com/sveltejs/svelte/issues/13180#issuecomment-2339851752, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI . You are receiving this because you authored the thread.Message ID: @.***>

paoloricciuti commented 1 week ago

https://stackblitz.com/edit/sveltejs-kit-template-default-anxbmg?file=src%2Flib%2FButton.svelte I don't know how to change the project to svelte 5 but I just did the same syntax as I would. What the error I would get is that Button is not defined. IN svelte 4 this is not a problem. It begins working again when ts is stripped out of my components On Tue, 10 Sept 2024 at 03:13, Paolo Ricciuti @.> wrote: I can't access the reproduction...can you please create the same on https://sveltelab.dev or https://stackblitz.com ? — Reply to this email directly, view it on GitHub <#13180 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI . You are receiving this because you authored the thread.Message ID: @.>

Here's your project with updated svelte 5 and vite plugin svelte...i don't see any error

Arashm-2009 commented 6 days ago

Thanks for responding. I went back to my code and I saw the error was gone. However when I made new components, the same error occurred. Hopefully it won’t be a problem when the stable version comes out.

On Tue, Sep 10, 2024 at 4:57 PM Paolo Ricciuti @.***> wrote:

https://stackblitz.com/edit/sveltejs-kit-template-default-anxbmg?file=src%2Flib%2FButton.svelte I don't know how to change the project to svelte 5 but I just did the same syntax as I would. What the error I would get is that Button is not defined. IN svelte 4 this is not a problem. It begins working again when ts is stripped out of my components … <#m-2619113378345039067> On Tue, 10 Sept 2024 at 03:13, Paolo Ricciuti @.> wrote: I can't access the reproduction...can you please create the same on https://sveltelab.dev https://sveltelab.dev or https://stackblitz.com https://stackblitz.com ? — Reply to this email directly, view it on GitHub <#13180 (comment) https://github.com/sveltejs/svelte/issues/13180#issuecomment-2339851752>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI . You are receiving this because you authored the thread.Message ID: @.>

Here's your project https://stackblitz.com/edit/sveltejs-kit-template-default-chy9aa?file=src%2Flib%2FButton.svelte with updated svelte 5 and vite plugin svelte...i don't see any error

— Reply to this email directly, view it on GitHub https://github.com/sveltejs/svelte/issues/13180#issuecomment-2341997348, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKV4SHTBACSX37AXEMLZV5MMTAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHE4TOMZUHA . You are receiving this because you authored the thread.Message ID: @.***>

paoloricciuti commented 6 days ago

Thanks for responding. I went back to my code and I saw the error was gone. However when I made new components, the same error occurred. Hopefully it won’t be a problem when the stable version comes out. On Tue, Sep 10, 2024 at 4:57 PM Paolo Ricciuti @.> wrote: https://stackblitz.com/edit/sveltejs-kit-template-default-anxbmg?file=src%2Flib%2FButton.svelte I don't know how to change the project to svelte 5 but I just did the same syntax as I would. What the error I would get is that Button is not defined. IN svelte 4 this is not a problem. It begins working again when ts is stripped out of my components … <#m-2619113378345039067> On Tue, 10 Sept 2024 at 03:13, Paolo Ricciuti @.> wrote: I can't access the reproduction...can you please create the same on https://sveltelab.dev https://sveltelab.dev or https://stackblitz.com https://stackblitz.com ? — Reply to this email directly, view it on GitHub <#13180 (comment) <#13180 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI https://github.com/notifications/unsubscribe-auth/BGW5QKX5VLOQUEIU26OUUFTZV2LZFAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA2TCNZVGI . You are receiving this because you authored the thread.Message ID: @.> Here's your project https://stackblitz.com/edit/sveltejs-kit-template-default-chy9aa?file=src%2Flib%2FButton.svelte with updated svelte 5 and vite plugin svelte...i don't see any error — Reply to this email directly, view it on GitHub <#13180 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGW5QKV4SHTBACSX37AXEMLZV5MMTAVCNFSM6AAAAABN5RZW5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHE4TOMZUHA . You are receiving this because you authored the thread.Message ID: @.>

It shouldn't be a problem now either...so please if you can find a reliable way to reproduce we can take a look