opentui icon indicating copy to clipboard operation
opentui copied to clipboard

Help: Failing to run TypeScript examples on Mac Silicon system

Open peoray opened this issue 2 weeks ago • 7 comments

bun run src/examples/index.ts

error: Cannot find module '@opentui/core-darwin-arm64/index.ts' from '/opentui/packages/core/src/zig.ts'

Bun v1.3.2 (macOS arm64)

Tried following the docs to run the example, but getting the error above.

peoray avatar Nov 19 '25 23:11 peoray

Yeah, you need to checkout a tag for a release and run bun install or have zig and run bun run build from the root. That needs some updating in the docs.

There now also is a prebuilt example standalone executable in the release https://github.com/sst/opentui/releases/tag/v0.1.47 - it's the exact examples from the repo.

kommander avatar Nov 19 '25 23:11 kommander

@kommander I don't quite understand what you mean. I already have zig installed. The command I ran was from /core folder. Is there something else I need to do?

My goal is to contribute to the Vue package. I don't even know how I can do that or see how to test that as well to be able to contribute

peoray avatar Nov 20 '25 00:11 peoray

Update:

bun run build
$ cd packages/core && bun run build && cd ../solid && bun run build && cd ../react && bun run build
$ bun run build:native && bun run build:lib
$ bun scripts/build.ts --native
Building native prod binaries...
/.cache/zig/p/uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE/build.zig:164:34: error: struct 'array_list.Aligned(u8,null)' has no member named 'init'
    var bytes = std.ArrayList(u8).init(allocator);
                ~~~~~~~~~~~~~~~~~^~~~~
/opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/array_list.zig:606:12: note: struct declared here
    return struct {
           ^~~~~~
referenced by:
    build: /.cache/zig/p/uucode-0.1.0-ZZjBPpAFQABNCvd9cVPBg4I7233Ays-NWfWphPNqGbyE/build.zig:98:78
    runBuild__anon_95475: /opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/Build.zig:2214:33
    12 reference(s) hidden; use '-freference-trace=14' to see all references
build.zig:106:10: error: no field named 'root_source_file' in struct 'Build.TestOptions'
        .root_source_file = b.path("test.zig"),
         ^~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/Build.zig:856:25: note: struct declared here
pub const TestOptions = struct {
                        ^~~~~~
Error: Zig build failed
error: script "build:native" exited with code 1
error: script "build" exited with code 1
error: script "build" exited with code 1

I got the error while trying out bun run build from the root folder

peoray avatar Nov 20 '25 00:11 peoray

@peoray you'll need to downgrade to zig 0.14.1 at the moment

msmps avatar Nov 20 '25 00:11 msmps

What @msmps said and the vue package needs to move to its own repo, see my comment in #236 for my reasoning.

kommander avatar Nov 20 '25 00:11 kommander

@kommander I have been able to get it running. Thanks @msmps.

As per the vue package, by another repo, you mean a repo inside of SST or external? If external, I'm happy to do so and make a framework-compatible version of the official maintained libraries

noob question, how can I run the react/solid code to see the examples to compare with the vue codebase?

peoray avatar Nov 20 '25 00:11 peoray

I mean an external repo.

For react/solid that should be just bun run [example].tsx.

kommander avatar Nov 20 '25 18:11 kommander