T
tscircuit2mo ago
shibo

3D Viewer, jscad-fiber, jscad-electronics, React 19 Issue

@Seve can you please take over the dependency issues in 3d-viewer and runframe? I have so much to do and I've been stuck for days, I don't want to waste any more time on this
64 Replies
Seve
Seve2mo ago
Yes maybe I can bring @Rishabh or @Abimael Martell in on this as well... @Rishabh @Abimael Martell the issue is we have multiple react versions caused by dependencies iiuc It is on the main branch of the 3d-viewer and can be seen looking at the storybook
shibo
shiboOP2mo ago
the issue also breaks runframe when you try to update it's deps
Seve
Seve2mo ago
clarification: When you update 3d-viewer in RunFrame, it breaks
DOPΣ
DOPΣ2mo ago
i found a possible root in jscadfiber
DOPΣ
DOPΣ2mo ago
prolly i found a fix, sending experimental patches
No description
shibo
shiboOP2mo ago
in the 3d-viewer check the second keyboard story
shibo
shiboOP2mo ago
doesn't extranous packages mean you need to delete the node modules?
DOPΣ
DOPΣ2mo ago
idk
Seve
Seve2mo ago
i think Shibo is saying if you do rm -rf node_modules && bun i those deps will be removed they're only there because your node modules is stale idk worth a try ig
DOPΣ
DOPΣ2mo ago
already tried
DOPΣ
DOPΣ2mo ago
worked
No description
Seve
Seve2mo ago
Hell yea Yes lets do it
DOPΣ
DOPΣ2mo ago
Ok few things - this is working with vite polyfills, on vite server - is this review valid or not. Without that change it's throwing type errors https://github.com/tscircuit/jscad-fiber/pull/113#pullrequestreview-3112565099 If nothing's wrong i would merge jscad pr And then update 3d, runframe and tscircuit.com
Seve
Seve2mo ago
yea your code is wrong the type error is fixeable via changing the intrinsic-jsx it's definitely recursive and should crash but otherwise yea that plan sounds good
shibo
shiboOP2mo ago
@DOPΣ just to be on the same page, how did you determine an issue got fixed? The issue didnt break the viewer for me just caused components that use jscad-electronics to throw a reconciler error
shibo
shiboOP2mo ago
Something like this
No description
shibo
shiboOP2mo ago
But thats in 3d-viewer, I think in runframe it breaks completely, sorry, maybe I'm just confused
DOPΣ
DOPΣ2mo ago
That error is still there ig I'm trying to fix React Owner undefined error I expiernced on runframe and threed view' I'm not saying completely fixing but locally when I tried jscad updated fiber linked with3d and runframe it's working with latest 3d viewer For 3d viewer check there might be some story showing react owner error on latest version, I forgot where I saw I'm updating jscad then threede view and runframe To see if the error i identified earlier React owner is fixed or not For your error I'm not sure, but yeah the symptoms are same
clarification: When you update 3d-viewer in RunFrame, it breaks
Um we can't be sure 109% till we ship it so yeah risking merge jscad fiber pr
DOPΣ
DOPΣ2mo ago
try clearing console, that would work fixed that in prod 3d-viewer
No description
shibo
shiboOP2mo ago
Awesome What about runframe?
DOPΣ
DOPΣ2mo ago
on it updating in prod these deps install take lifetime
shibo
shiboOP2mo ago
How?
DOPΣ
DOPΣ2mo ago
No description
Seve
Seve2mo ago
We need to check bundle sizes more, many modules are accidentally bundling
shibo
shiboOP2mo ago
You running windows?
DOPΣ
DOPΣ2mo ago
ofc ;-;
No description
No description
shibo
shiboOP2mo ago
Use wsl It's great, will solve your slow dep install issues
DOPΣ
DOPΣ2mo ago
umm is ok normally, but when my ram usage reaches heights, it struggled, ill update ram soon, thx
shibo
shiboOP2mo ago
@DOPΣ any updates on runframe?
DOPΣ
DOPΣ2mo ago
I'm tired trying to fix 3d preview for tscircuit.com w/runframe Latest react 19 is working fine on jscadfiber 3d viewer and runframe But on tscircuit.com 3d preview is coming very much stretched Im noob in threejs, since you transported from fiber to vanilla three, can you find any fix? Even tried with ai, You can try latest runframe with latest 3d view (or take from my unmerged pr), build it locally and try bun link to use with tscircuit.com locally Also I need to update circuit json on fiber and 3d viewer to prevent crypto error you might face
shibo
shiboOP2mo ago
K, give me your fork/branch Ill test with it
DOPΣ
DOPΣ2mo ago
Oh randomlyy bot pr merged and conflicts, too much struggle
No description
shibo
shiboOP2mo ago
No description
shibo
shiboOP2mo ago
nvm, fixed it
DOPΣ
DOPΣ2mo ago
are you able to repro?
shibo
shiboOP2mo ago
shibo
shiboOP2mo ago
first time this happens
DOPΣ
DOPΣ2mo ago
ram issue
Seve
Seve2mo ago
I'm seeing this issue
No description
shibo
shiboOP2mo ago
@DOPΣ I fixed the overflow issue, but now when I yalc push runframe to tscircuit.com It doesn't update any idea why that could be?
DOPΣ
DOPΣ2mo ago
Can you send pr where you fixed issue? I can try locally
shibo
shiboOP2mo ago
I didn't fix your issue with the 3d-viewer, just my issue with stackoverflow
DOPΣ
DOPΣ2mo ago
oh, try bun link, then
shibo
shiboOP2mo ago
now in tscircuit.com I get a react error, updating react and react-dom 19 didn't fix the issue, what did you do to resolve that?
DOPΣ
DOPΣ2mo ago
Umm it's working fine for me locally, can you send error
shibo
shiboOP2mo ago
the only thing I've done is link runframe and update react and react dom to 19
TypeError: can't access property "ReactCurrentOwner", ReactSharedInternals is undefined
$$$reconciler react-reconciler.development.js:498
<anonymous> index.js:1320


The above error occurred in one of your React components.

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
react-dom-client.development.js:8331:17
React 32
performWorkUntilDeadline scheduler.development.js:45
TypeError: can't access property "ReactCurrentOwner", ReactSharedInternals is undefined
$$$reconciler react-reconciler.development.js:498
<anonymous> index.js:1320


The above error occurred in one of your React components.

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
react-dom-client.development.js:8331:17
React 32
performWorkUntilDeadline scheduler.development.js:45
DOPΣ
DOPΣ2mo ago
Prolly it's not updated, try clearing node modules and install with --no-cache That error is most prolly because of react18 :/ that's best I know, worked for me
shibo
shiboOP2mo ago
I managed to get it working, and I reproduced your issue let me see if I can find a fix
DOPΣ
DOPΣ2mo ago
Thanks 😭
shibo
shiboOP2mo ago
Did you try changing the style of the 3d-viewer? I ruled out runframe I'll test changing 3d-viewer later on
DOPΣ
DOPΣ2mo ago
Umm yea, but didn't worked, or prolly idk what to change in three
shibo
shiboOP2mo ago
@DOPΣ no luck
DOPΣ
DOPΣ2mo ago
No description
shibo
shiboOP2mo ago
@Seve can you help with this?
Seve
Seve2mo ago
Is it on main? Note that Abse just got a version of jscad electronics that doesn’t require react to work Sry havent been following tell me how to repro and can jump on it, tscircuit.com or runframe?
shibo
shiboOP2mo ago
runframe and tscircuit.com, the main problem is that the 3d-viewer in tscircuit.com doesn't scale properly like this I and Arnav couldn't find a solution
Seve
Seve2mo ago
This is on main? Or do i need to update 3d-viewer
shibo
shiboOP2mo ago
you do, and also update to react 19
Seve
Seve2mo ago
Kk
shibo
shiboOP2mo ago
so not on main
Seve
Seve2mo ago
@shibo @DOPΣ so i'm super limited on time this week due to the funding stuff (I spent all day doing paperwork/projections and stuff) but I just did bun update --latest react react-dom @types/react @tscircuit/3d-viewer and made sure to clear the lockfile and node modules and it seemed to work just fine (PR here but it can't be merged and I'm not working on it so can be ignored or just used as reference https://github.com/tscircuit/runframe/pull/1011) The only thing that seems to not work is the jscad footprints. I'm guessing that jscad-electronics is incorrectly bundling react based on the error (remember, react should never be bundled, to not be bundled it needs to be a peerDep or external) MY SUGGESTION TO FIX: @Abse merged a PR recently that created a version of jscad-electronics that doesn't use/need React. It can be used via import { getModelFromFootprint } from "jscad-electronics/vanilla. This would probably fix the issue easily and prevent any issues with transient React!
No description
shibo
shiboOP2mo ago
Im busy with boards and SPICE sim, I doubt I'll have tine for this

Did you find this page helpful?