-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Can't add react application in angular as parcel app #335
Comments
The problem is that you're using a relative import ( First, you cannot import a React component directly into your Angular application. By using a relative import, that React component is being pulled into your Angular application and put through Angular's Webpack build pipeline which does not support React. Instead, that Parcel needs to be built and served separately in order to be able to resolve it at runtime using SystemJS and cross microfronted imports. Second, your Parcel is already exporting the lifecycles so you to not need to import the individual lifecycles to create this object. Just do |
You need to do two things:
You can either enumerate each package to be marked as external or use a regex like our other base webpack configs do. I'm not super familiar with how Angular allows devs to modify their webpack configs, but our docs have an example of adding to the externals here: https://single-spa.js.org/docs/ecosystem-angular/#inter-app-communication-via-rxjs |
Thank you @filoxo very much, you solved my problem. If I would have any questions in the future regarding this same problem I would ask them here. |
Glad you were able to get it working! I'm going to ahead and close this issue. Feel free to reopen if you encounter more bugs/issues, and you can always ask questions in the Slack channel too. |
Hi,
I am trying to use a single spa framework in my project and I want to build react and angular parcel apps and use them in angular and react applications as parcels. I have a problem with adding react application to angular as parcel app and I keep getting this error.
My angular application code where I want to use this parcel app.
The other way around I succeeded but I keep getting this error for this case. Would appreciate help regarding my issue.
The text was updated successfully, but these errors were encountered: