Skip to content

How do you access runtime.js from App.svelte? #2898

Closed

Description

@MerreM

Have you read the Documentation Contribution Guidelines?

Description

I'm trying import EventsOn from "../wailsjs/runtime/runtime.js";

Which results in the below error;

RollupError: "default" is not exported by "wailsjs/runtime/runtime.js", imported by "src/App.svelte".

I can access the methods via window.runtime - but there must be a way to import them, surely?

Self-service

  • I'd be willing to address this documentation request myself.

Activity

  1. samfweb commented on Sep 10, 2023

    @samfweb

    Try without the .js:
    import WailsRuntime from "../wailsjs/runtime/runtime";

    Alternatively:
    import {EventsOn, EventsOff } from "../wailsjs/runtime/runtime";

  2. locked and limited conversation to collaborators on Apr 8, 2025
  3. converted this issue into a discussion #4200 on Apr 8, 2025
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

    DocumentationImprovements or additions to documentationEnhancementNew feature or requestv3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions