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

[bug] Cannot read properties of undefined (state, isMobile) #1454

Closed
hhamja opened this issue Nov 6, 2024 · 5 comments
Closed

[bug] Cannot read properties of undefined (state, isMobile) #1454

hhamja opened this issue Nov 6, 2024 · 5 comments

Comments

@hhamja
Copy link

hhamja commented Nov 6, 2024

Describe the bug

I added the sidebar of shadcn, which was newly released in svelte5 version, and added the code according to the usage instructions. It says that all status values ​​defined for the sidebar cannot refer to properties.

Reproduction

I added the sidebar of shadcn, which was newly released in svelte5 version, and added the code according to the usage instructions. It says that all status values ​​defined for the sidebar cannot refer to properties.

Logs

TypeError: Cannot read properties of undefined (reading 'state')
    at _layout (/Users/gimminseog/hacking/mundi-mvp/src/routes/+layout.svelte:8:10)
    at Root (/Users/gimminseog/hacking/mundi-mvp/.svelte-kit/generated/root.svelte:65:3)
    at Module.render (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/[email protected]/node_modules/svelte/src/internal/server/index.js:117:2)
    at Function._render [as render] (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/[email protected]/node_modules/svelte/src/legacy/legacy-server.js:27:18)
    at Module.render_response (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@2_n73cut2ozdmfw5oaoigy64bexq/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:171:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.respond_with_error (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@2_n73cut2ozdmfw5oaoigy64bexq/node_modules/@sveltejs/kit/src/runtime/server/page/respond_with_error.js:85:10)
    at async resolve (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@2_n73cut2ozdmfw5oaoigy64bexq/node_modules/@sveltejs/kit/src/runtime/server/respond.js:524:12)
    at async Module.respond (/Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@2_n73cut2ozdmfw5oaoigy64bexq/node_modules/@sveltejs/kit/src/runtime/server/respond.js:327:20)
    at async file:///Users/gimminseog/hacking/mundi-mvp/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@2_n73cut2ozdmfw5oaoigy64bexq/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:524:22

System Info

Mac os M3

Severity

annoyance

@ieedan
Copy link
Contributor

ieedan commented Nov 6, 2024

Can you provide a minimal reproduction? This isn't quite enough information to troubleshoot.

@nikolaydyankov
Copy link

Did you forget <Sidebar.Provider> perhaps?

@huntabyte
Copy link
Owner

As @nikolaydyankov said, seems likely that it's missing the provider with those errors.

@dangelomedinag
Copy link

I got the same error and after a few minutes of tracking down where the problem was, I just needed to update bits-ui to version @next

bun i bits-ui@next

I did the installation in a new project following the documentation

bunx shadcn-svelte@next init

and there the version was installed [email protected]

@huntabyte
Copy link
Owner

That's likely because bun is an inferior package manager to pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants