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

Assertion failed error #233

Closed
rortan134 opened this issue Dec 14, 2023 · 12 comments
Closed

Assertion failed error #233

rortan134 opened this issue Dec 14, 2023 · 12 comments

Comments

@rortan134
Copy link

Version 1.0.1

image
image

<PanelGroup direction="horizontal" onLayout={onLayout}>
      <Panel order={1}>{/* ... */}</Panel>
      <PanelResizeHandle />
      <Panel order={2}>{/* ... */}</Panel>
      <PanelResizeHandle />
      <Panel order={3}>{/* ... */}</Panel>
    </PanelGroup>
@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

@rortan134 I'm going to need more of a repro than this. Can you share a Code Sandbox that reproduces the bug you're seeing? I have no idea what's in your app-index.js file on line 32.

@rortan134
Copy link
Author

app-index is dev (nextjs) compiled code
image

Reverting back to 0.64 works fine (with the props changed)

reproduction

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

The sandbox you linked to me does not log or throw any errors. Works fine.

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

Looking at your code, it is worth pointing out that you have invalid constraints:

        <ResizablePanel order={0} minSize={200} maxSize={300}></ResizablePanel>
        <ResizablePanelHandle />
        <ResizablePanel order={1} minSize={200} maxSize={200}></ResizablePanel>
        <ResizablePanelHandle />
        <ResizablePanel order={2} minSize={200} maxSize={300}></ResizablePanel>

Min and max sizes should be percentages (0-100%) so 200% and 300% aren't valid numbers.

@rortan134
Copy link
Author

rortan134 commented Dec 14, 2023

Looking at your code, it is worth pointing out that you have invalid constraints:

I abstracted it so I can pass in pixel values (look at the my-drawer.tsx components)

The sandbox you linked to me does not log or throw any errors. Works fine.

I just tried it in two other browsers and it seems to happen consistently (Opera above and chrome below)
image

(I forgot switching the error tab on chrome to show the error but its there)

Doesn't seem to happen on firefox though...

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

I'm testing on Chrome and it doesn't happen for me. My guess is that there's a problem in your abstraction somewhere.

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

You might be able to record a Replay of the bug happening which would be helpful for me to look at (but Replay is also Gecko based so maybe not)

@rortan134
Copy link
Author

rortan134 commented Dec 14, 2023

Oh wow, turns out I still had the panels persisted layout stored in localStorage on every browser I tested from previous updates and mistakenly reused the same panels IDs on every test I did... Sorry for the misunderstanding. 🤦‍♂️

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

No problem. That’s an easy mistake to make.

I’m not sure how to detect and warn about this case, but it does seem like some thing that I could maybe do a better job of surfacing in development mode

any ideas?

@rortan134
Copy link
Author

No problem. That’s an easy mistake to make.

I’m not sure how to detect and warn about this case, but it does seem like some thing that I could maybe do a better job of surfacing in development mode

any ideas?

I guess you could attach a version identifier to the stored localstorage key and compare it with the current package version on first render. The only reason this happened though is that we went from defaultSize to defaultSizePixels back to defaultSize, so I don't think it'll be happening again now that it's at 1.0 right?

@bvaughn
Copy link
Owner

bvaughn commented Dec 14, 2023

The only reason this happened though is that we went from defaultSize to defaultSizePixels back to defaultSize, so I don't think it'll be happening again now that it's at 1.0 right?

I think that's true.

@bvaughn
Copy link
Owner

bvaughn commented Dec 15, 2023

Updated the storage key to avoid this scenario in 1.0.2

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

No branches or pull requests

2 participants