Skip to content

Failed to fetch dynamically imported module when trying to access a remote app from the host using the NX workspace, yarn, React, and Vite #693

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

Open
AdHiadithyan2 opened this issue Apr 8, 2025 · 0 comments

Comments

@AdHiadithyan2
Copy link

AdHiadithyan2 commented Apr 8, 2025

Failed to fetch dynamically imported module when trying to access a remote app from the host using the NX workspace, yarn, React, and Vite

Failed to fetch dynamically imported module: http://localhost:3001/node_modules/.vite/packages/twenty-front/deps/react.js?v=206b7b18

When using React-based hooks, I'm getting the error if not using then its works fine

Versions

  • vite-plugin-federation: 1.4.0
  • vite: 6.2.5

Reproduction

https://github.com/twentyhq/twenty use this git

Additional Details

**Working**
import React, { useEffect } from 'react';

const Button: React.FC = () => {

return (
<button
style={{ padding: '10px', fontSize: '16px' }}
onClick={() => console.log('Button clicked23')}
>
I'm Remote!

);
};




Not Working


import React, { useEffect } from 'react';

const Button: React.FC = () => {
useEffect(() => {
console.log('Button mounted');
}, []);

return (
<button
style={{ padding: '10px', fontSize: '16px' }}
onClick={() => console.log('Button clicked23')}
>
I'm Remote!

);
};

Steps to reproduce

https://github.com/twentyhq/twenty use this git
create a remote-app and try to import in app
getting error when trying to use react hooks

What is Expected?

need to render react hook and all other packages

What is actually happening?

not able to use react based hooks
getting error
Failed to fetch dynamically imported module: http://localhost:3001/node_modules/.vite/packages/twenty-front/deps/react.js?v=206b7b18

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