FederatedTypesPlugin stalls on typescript compilation errors #1703
Replies: 2 comments 4 replies
-
Hi, you could try the latest package, which has some extra options to host the types outside of web pack dev serve. If you check the read me for the package it has some details on setting up the separate host. Let me know if this resolves it for you |
Beta Was this translation helpful? Give feedback.
-
I can update the documentation, On the project you want to serve from, use the “typeServeOption” and set up localhost and any port that is free. It will start a node server when webpack runs, and serve the types generated on that host and port. It has retry options as well which are sometimes necessary in these scenarios where projects are all trying to start at once, it is enabled by default but can be increased. on the consumer side, use the same federated types plugin but point the remote to that new url. So instead of just passing the MF config in, you’d need to pass the new “localhost:” value you are serving from. Let me know if this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using FederatedTypesPlugin() to stream types for the exposed MFE-s.
The problem is, if I have some errors in the exposed modules .tsx files (and any recursive import of it), webpack will stall and won't serve localhost/__types_index.json, which is necessary for the other party (the host) to fetch types. Note: the type declarations are successfully generated in spite of those errors, so I'd like webpack to go forward and start serving those files.
If I set the flag FederatedTypesPlugin({ disableTypeCompilation: true }), it won't even bother to generate the type declarations, and won't serve localhost/__types_index.json.
Any ideas on this?
The desired outcome would be, to enable webpack (or the FederatedTypesPlugin() ) to somehow ignore those tsc compilation errors, and proceed with the serving of the webapp.
Beta Was this translation helpful? Give feedback.
All reactions