-
Notifications
You must be signed in to change notification settings - Fork 49
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
Problems with Dependencies Sharing #63
Comments
I should have read the readme more carefully.. |
Hi I know I'm a bit late, but what was it that was wrong and how did you solve it? |
Hi, thanks for your response. If I remember correctly, I moved /**
* These dependencies will be made available to the Remote Components.
*/
module.exports = {
resolve: {
react: require("react"),
"@ionic/react": require("@ionic/react"),
"@ionic/react-router": require("@ionic/react-router"),
"@microsoft/signalr": require("@microsoft/signalr"),
// "chart.js": require("chart.js"),
"date-fns": require("date-fns"),
"ionicons": require("ionicons"),
// "react-chartjs-2": require("react-chartjs-2"),
"react-dom": require("react-dom"),
"react-router": require("react-router"),
"react-router-dom": require("react-router-dom")
},
}; I then also add them on /**
* Dependencies for Remote Components
*/
module.exports = {
resolve: {
"react": "react",
"@ionic/react": "@ionic/react",
"@ionic/react-router": "@ionic/react-router",
"@microsoft/signalr": "@microsoft/signalr",
"@types/react": "@types/react",
"@types/react-dom": "@types/react-dom",
"@types/react-router": "@types/react-router",
"@types/react-router-dom": "@types/react-router-dom",
"react-router-dom": "react-router-dom",
// "chart.js": "chart.js",
"date-fns": "date-fns",
"ionicons": "ionicons",
// "react-chartjs-2": "react-chartjs-2",
"react-dom": "react-dom",
"react-router": "react-router",
"react-router-dom": "react-router-dom"
}
}; Found it related to https://github.com/Paciolan/remote-component#creating-a-remote-component-with-webpack and https://github.com/Paciolan/remote-component-starter#external-dependencies so that it gets included in externals, I've been trying to understand how remote component actually works. Am I doing this correctly? |
I'm not so familiar with JS modules and webpack and so far working with remote component, I have encountered a few issues that seems to happen only when working in remote component, but not occurring when in main application. I often have issues especially when working with chart.js in remote component. Some other issues when Chart.js is shared with the method described in the previous comment was it complaining the Line component is not exported. Time adapters also don't work inside the remote component. Workaroud was chartjs/chartjs-adapter-date-fns#58 (comment) Do you have any clues on why it happens or maybe ways to fix it? I suspect it has something to do with modules system but aren't modules transpiled for browser compatibility before being loaded with remote component? |
Hi, I'm working on an Ionic application where I load remote components from, and on the remote component which i forked form remote component starter, i tried putting shared dependencies into remote-component.config.js.
The first one i tried was putting
"@ionic/react": require("@ionic/react"),
and I'm gettingAny clue why this is happening?
Thanks in advance!
The text was updated successfully, but these errors were encountered: