mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #41] Bun v1.2.13: crash in @opentui/core/3d when running Sprite Animation example because console.Console is undefined #7
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Montekkundan on GitHub (Aug 19, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/41
Running the Sprite Animation example on Bun throws
TypeError: undefined is not a constructorwhere@opentui/core/3d.jsconstructs newconsole.Console(...)and overwritesglobal.console.Env
@opentui/core0.1.6Repro
index.ts:Error
@kommander commented on GitHub (Aug 19, 2025):
Is this in a new and empty folder with
bun init? What does// run the Sprite Animation exampledo exactly here?@Montekkundan commented on GitHub (Aug 20, 2025):
Yes, https://github.com/Montekkundan/opentui-projects
running the same https://github.com/sst/opentui/blob/main/packages/core/src/examples/sprite-animation-demo.ts file with revised imports
@kommander commented on GitHub (Aug 20, 2025):
The issue is that the 3d entry point bundles all of core and executes certain sections twice, which shouldn't happen. Also, threejs >v0.177.0 is not yet supported. I fixed the entry point and pinned the threejs version in the optional dependencies. Will be in the v0.1.8 release coming shortly.
@KurtGokhan commented on GitHub (Aug 23, 2025):
This also happens on any code when running with Bun hot reloading and making changes to files. Is there a plan to support Bun hot reloading?
@kommander commented on GitHub (Aug 23, 2025):
@KurtGokhan Not on the roadmap yet, but will be. The react/solid wrappers will support HMR though.
@KurtGokhan commented on GitHub (Aug 23, 2025):
Thanks. I created #57 to prevent the crash caused by
undefined.I also tried to make a POC for hot reload, but for some reason
import.meta.hotisn't available in Bun even though the docs imply it is. Will try to follow-up later.@msmps commented on GitHub (Aug 23, 2025):
I'm actively working on HMR for the React reconciler as @kommander mentioned above.
import.meta.hotisn't present unless using the bun full-stack server (not just the hot flag) is my understanding but I'm working through that at present and hope to ship soon 👍@KurtGokhan commented on GitHub (Aug 23, 2025):
I see. I actually need server-side HMR, so no luck until Bun properly supports it I guess. Found the docs saying
import.meta.hotAPI will be added later.@kommander commented on GitHub (Aug 23, 2025):
I'll consider this solved for now and would move HMR to other issues.