Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue Bridge package lacks dist #2760

Closed
5 tasks done
HUST-SE-LY opened this issue Jul 17, 2024 · 4 comments
Closed
5 tasks done

Vue Bridge package lacks dist #2760

HUST-SE-LY opened this issue Jul 17, 2024 · 4 comments
Assignees

Comments

@HUST-SE-LY
Copy link

Describe the bug

After executing pnpm add @module-federation/bridge-vue3@latest , I found that there is no dist directory in the bridge-vue3 package in node_modules, so I cannot import createBridgeComponent.
image
image
In addition, I found that vue3-bridge uses vue-router@3 instead of vue-router@4, so dependency conflicts are easy to occur.Is there any reason for this?

Reproduction

https://github.com/HUST-SE-LY/mf-vue3-demo

Used Package Manager

pnpm

System Info

System:
    OS: macOS 14.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.39 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.1 - ~/.nvm/versions/node/v18.20.1/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.1/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 126.0.6478.182
    Safari: 17.4.1

Validations

@zackarychapple
Copy link
Collaborator

Just talked to @ScriptedAlchemy he will get a fix out ASAP.

@danpeen
Copy link

danpeen commented Jul 18, 2024

try this version: @module-federation/bridge-vue3@0.0.0-next-20240718040714, i think it should be fixed

@HUST-SE-LY
Copy link
Author

HUST-SE-LY commented Jul 18, 2024

try this version: @module-federation/bridge-vue3@0.0.0-next-20240718040714, i think it should be fixed

thx, it works.
I still have some questions. I use webpack and the second way below which is from official site will cause an error. it throws TypeError: t.loader is not a function. The first way below looks good.

// right way
const container = bridge.createRemoteComponent({
  loader: () => loadRemote('container/export-app'),
});

// wrong way in https://module-federation.io/practice/bridge/vue-bridge.html
const Remote2 = bridge.createRemoteComponent(() =>
  loadRemote('container/export-app'),
);

And vue-router reports a warning

[Vue Router warn]: Component "default" in record with path "/container/:pathMatch(.*)*" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".
image image

@danpeen
Copy link

danpeen commented Jul 19, 2024

Yes, sorry, it should pass the loader parameter, I will fix this. Thank you~

@danpeen danpeen closed this as completed Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants