GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SwiftBuild] PackageToJS plugin fails to generate correct js initializer code · Issue #796 · swiftwasm/JavaScriptKit

[SwiftBuild] PackageToJS plugin fails to generate correct js initializer code #796

New issue
Copy link
New issue
Copy link
Closed
Closed
[SwiftBuild] PackageToJS plugin fails to generate correct js initializer code#796
Copy link

Description

@sliemeobn
sliemeobn
opened on Aug 4, 2026
Issue body actions

for a browser / WASI use case this will result in an error like: "wasi_snapshot_preview1": module is not an object or function

because triple detection is based on the build output path:

JavaScriptKit/Plugins/PackageToJS/Sources/PackageToJS.swift

Lines 72 to 81 in e53155d

static func deriveBuildConfiguration(wasmProductArtifact: URL) -> (configuration: String, triple: String) {
// e.g. path/to/.build/wasm32-unknown-wasi/debug/Basic.wasm -> ("debug", "wasm32-unknown-wasi")
// First, resolve symlink to get the actual path as SwiftPM 6.0 and earlier returns unresolved
// symlink path for product artifact.
let wasmProductArtifact = wasmProductArtifact.resolvingSymlinksInPath()
let buildConfiguration = wasmProductArtifact.deletingLastPathComponent().lastPathComponent
let triple = wasmProductArtifact.deletingLastPathComponent().deletingLastPathComponent().lastPathComponent
return (buildConfiguration, triple)
}

and swift-build produces different out paths like this: .build/out/Products/Release-webassembly-wasm32/App.wasm

template variables like IS_WASI are no longer correctly derived

JavaScriptKit/Plugins/PackageToJS/Sources/PackageToJS.swift

Line 813 in e53155d

"IS_WASI": triple.hasPrefix("wasm32-unknown-wasi"),

Activity

  1. sliemeobn commented on Aug 22, 2026

    @sliemeobn
    sliemeobn
    on Aug 22, 2026
    ContributorAuthor
    More actions

    fixed in #807

  2. sliemeobn
    closed this as completedon Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.