Skip to content

load Soukai only once #139

@michielbdejong

Description

@michielbdejong

About bookmarks/soukai/demo, where the app from npm run preview is behaving differently from the npm run dev one, Noel wrote:

I looked at the Bookmarks demo and I found the problem. There are two instances of soukai because there is an import to "../../src/modules/Bookmarks" in utils.ts. So the Bookmark model is using one instance of the library (the one inside of bookmarks/soukai/node_modules), whilst the setEngine is using another (the one inside of bookmarks/soukai/demo/node_modules).

I think you can solve this adding the following to the alias in your demo's vite.config.js:

'soukai': path.resolve(__dirname, './node_modules/soukai'),

That way, every time "soukai" is used, it'll import the same folder. Or you could also solve it by using npm workspaces to share the same node_modules folder, etc.

We should try that out!

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