Skip to content

[Bug]: Cannot load shared dependencies for the first time #362

@wojtask9

Description

@wojtask9

Describe the bug

npm i
npm run dev

open in browser http://localhost:5010/app-1

in console.log there be an error.

After pressing F5 everything is OK and everything works correct.

To reproduce bug you must kill npm run dev and launch again.

This issue is also reproduced with lastest versions (everything including vite, vue, module-federation, etc).

Not sure where the problem is but if you remove shared from remote apps (app1, app2) then issue doesn't exists.
Also porting to non deprecated init to use registerRemotes and checking if getInstance() != null (always is not null) issue still exists.

Issue exists in firefox and chrome. I'm using linux env.

This repo is taken from https://dev.to/lmlonghuynh/building-a-micro-frontend-architecture-with-vue-3-vite-and-module-federation-1bb1

Version

probably all

Reproduction

https://github.com/lmlong-huynh/micro-frontend-sample

Relevant log output

[MF] Error loading remote module: Error: [ Federation Runtime ]: Please call createInstance first. #RUNTIME-009
View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/runtime/RUNTIME-009
    error2 logger.ts:22
    assert2 logger.ts:10
    loadShare index.ts:71
    res chunk-DW7XOL6G.js:17
    promise callback*node_modules/__mf__virtual/app1__loadShare__vue__loadShare__.js chunk-DW7XOL6G.js:17
    __require chunk-ZKAWKZG5.js:11
    <anonymous> chunk-DW7XOL6G.js:31

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    COMMUNITY: PR is welcomedWe think it's a good feature to have but would love for the community to help with the PR for itbugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions