Skip to content

Failed to import svelt-yjs: require() is not supported #7

Description

@squirrelsquirrel78

Hi, when trying to add this (wonderful) library to my project, I get an error:

failed to import "svelt-yjs"

|- Error [ERR_REQUIRE_ESM]: require() of ES Module MYPATH/node_modules/svelte/src/runtime/store/index.js from MYPATH/node_modules/svelt-yjs/build/src/undo.js not supported.

Instead change the require of index.js in MYPATH/svelt-yjs/build/src/undo.js to a dynamic import() which is available in all CommonJS modules.

I'm using node v20.10 and npm v10.2.

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