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

feat(vite): Compatibility documentation #3065

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

zhangHongEn
Copy link
Contributor

@zhangHongEn zhangHongEn commented Oct 10, 2024

Description

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

changeset-bot bot commented Oct 10, 2024

⚠️ No Changeset found

Latest commit: cc8882d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit cc8882d
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/6708d07eabdfa60008b31d18
😎 Deploy Preview https://deploy-preview-3065--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@2heal1
Copy link
Member

2heal1 commented Oct 11, 2024

Thanks for your contribution of vite , I experienced this according to the documentation , and have two issues

  1. Should users add .__mf__temp to .gitignore ?
  2. I failed to start the simple demo , can you help me ?
    The minimal repo: https://github.com/2heal1/vite-mf-demo

@2heal1
Copy link
Member

2heal1 commented Oct 11, 2024

Thanks for your contribution of vite , I experienced this according to the documentation , and have two issues

  1. Should users add .__mf__temp to .gitignore ?
  2. I failed to start the simple demo , can you help me ?
    The minimal repo: https://github.com/2heal1/vite-mf-demo

When i visit host , the console will throw the below error :

chunk-7TTF2H5L.js?v=236053c7:837 Uncaught Error: [ Federation Runtime ]: 
      Unable to use the vite_provider's 'http://localhost:5175/remoteEntry.js' URL with vite_provider's globalName to get remoteEntry exports.
      Possible reasons could be:

      1. 'http://localhost:5175/remoteEntry.js' is not the correct URL, or the remoteEntry resource or name is incorrect.

      2. vite_provider cannot be used to get remoteEntry exports in the window object.
    
    at error2 (chunk-7TTF2H5L.js?v=236053c7:837:13)
    at Object.assert2 [as assert] (chunk-7TTF2H5L.js?v=236053c7:829:9)
    at chunk-7TTF2H5L.js?v=236053c7:1793:15

@zhangHongEn
Copy link
Contributor Author

It shouldn’t be impossible to start easily. Let me check.

@zhangHongEn
Copy link
Contributor Author

image That’s strange, everything is working fine on my end.

@zhangHongEn
Copy link
Contributor Author

      remotes:{
        // both can not work
        // vite_provider: 'vite_provider@http://localhost:5175/remoteEntry.js',
        vite_provider: {
          name: "vite_provider",
          entry: 'http://localhost:5175/remoteEntry.js',
          type: "module"
        },
      }

For the error message you’re encountering, you can try setting the type.

@2heal1
Copy link
Member

2heal1 commented Oct 11, 2024

Do you visit host page ? looks like you are visiting provider page

@zhangHongEn
Copy link
Contributor Author

Thanks for your contribution of vite , I experienced this according to the documentation , and have two issues

  1. Should users add .__mf__temp to .gitignore ?
  2. I failed to start the simple demo , can you help me ?
    The minimal repo: https://github.com/2heal1/vite-mf-demo

need add .__mf__temp to .gitignore

@2heal1
Copy link
Member

2heal1 commented Oct 11, 2024

      remotes:{
        // both can not work
        // vite_provider: 'vite_provider@http://localhost:5175/remoteEntry.js',
        vite_provider: {
          name: "vite_provider",
          entry: 'http://localhost:5175/remoteEntry.js',
          type: "module"
        },
      }

For the error message you’re encountering, you can try setting the type.

Thanks , that works for me

So maybe it need to add to the docs ? Include the .__mf__temp

@zhangHongEn
Copy link
Contributor Author

Adding .__mf__temp to the documentation feels a bit disorganized. I think it would be helpful to explain the remotes configuration in more detail.

@zhangHongEn
Copy link
Contributor Author

module-federation/vite#74
I can put this link in the .__mf__temp file and add a note saying “need to add .__mf__temp to .gitignore.”

@2heal1
Copy link
Member

2heal1 commented Oct 11, 2024

Adding .__mf__temp to the documentation feels a bit disorganized. I think it would be helpful to explain the remotes configuration in more detail.

Yeah that's perfect

@2heal1 2heal1 merged commit ca546d8 into module-federation:main Oct 12, 2024
14 checks passed
@2heal1 2heal1 mentioned this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants