Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BridgeJS] Uncaught TypeError: import object field '<project>' is not an Object

Open
#672 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, swift, wasm
Domain
api, web-dev

Research direction

Reproduce the runtime crash with the ElementaryUI and BridgeJS Counter example shown in the issue. Start by inspecting the generated WebAssembly imports and the JavaScript-side import object around the field. Done means the combined compilation starts without the reported uncaught TypeError.

Written by the indexing model from the issue text.

Description

When using ElementaryUI and BridgeJS combined compilation succeeds but runtime crashes on start with:

Uncaught TypeError: import object field '<project>' is not an Object
@View
struct Counter {
    @State var count = 0

    var body: some View {
        div {
            p { "Count: \(count)" }
            button { "Increment" }
                .onClick { count += 1 }
        }.onAppear {
            try? console().log("Hello from Swift!")
        }
    }
}

import JavaScriptKit

@JSFunction func console() throws(JSException) -> Console

@JSClass struct Console {
    @JSFunction func log(_ message: String) throws(JSException) -> Void
}
Dominant language
Swift
Stars
986
Forks
76
Avg merge
21h 11m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from swiftwasm/JavaScriptKit

All issues in swiftwasm/JavaScriptKit

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.