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

exporting variables from the shared module, the variables within the shared module appear as undefined #575

Open
platec opened this issue Feb 19, 2024 · 1 comment

Comments

@platec
Copy link

platec commented Feb 19, 2024

test.js

import { ref, onMounted } from 'vue';

export function test() {
  const dataSource = ref([]);

  onMounted(() => {
    dataSource.value = [1, 2, 3];
  });
}

export { h } from 'vue';

after vite building

import { importShared, __tla as __tla_0 } from "./__federation_fn_import-B4BZ4M9v.js";
let h, test;
let __tla = Promise.all([
  (() => {
    try {
      return __tla_0;
    } catch {
    }
  })()
]).then(async () => {
  const { ref, onMounted } = await importShared("vue");
  test = function() {
    const dataSource = ref([]);
    onMounted(() => {
      dataSource.value = [
        1,
        2,
        3
      ];
    });
  };
});
export {
  __tla,
  h,
  test
};

@platec
Copy link
Author

platec commented Feb 20, 2024

related issue #496

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

1 participant