Ionic 2 RC0 - Authentication with Cloud Angular or ng2 Cordova not working

Hello,

Has anyone run into this problem ? I am using Ionic 2 Cloud Module to authenticate. I also tryed using ng2-cordova-oauth and I get a similar error.

Error: Module .../node_modules/@ionic/cloud-angular/dist/es5/index.js does not export CloudModule
? 

Thank you !

1 Like

I have the same issue, comment please if fix it! Thanks a lot

Same issue here! Any workarounds until a fix is out? Simply adding it manually through a custom rollup file (like with other external libraries) does not work. When I tried I received the error “duplicate export…”

So, I got it working for me.

It appears that this error only occurs when you have a custom rollup.config.js file with some include & namedExports specified for the commonJS plugin. I had to adapt my rollup config in order to get rid of the error.

Please see my original rollup config below:

commonjs({
include: [
‘node_modules/rxjs/’,
'node_modules/firebase/
’,
‘node_modules/angularfire2/’,
'node_modules/ng2-charts/

],
namedExports: {
‘node_modules/firebase/firebase.js’: [‘initializeApp’, ‘auth’, ‘database’],
‘node_modules/angularfire2/node_modules/firebase/firebase-browser.js’: [‘initializeApp’, ‘auth’, ‘database’],
‘node_modules/ng2-charts/ng2-charts.js’: [‘ChartsModule’]
}
}),

I had to change that so that the “include” array only consists of "node_modules/" like so:

commonjs({
include: [
'node_modules/

],
namedExports: {
‘node_modules/firebase/firebase.js’: [‘initializeApp’, ‘auth’, ‘database’],
‘node_modules/angularfire2/node_modules/firebase/firebase-browser.js’: [‘initializeApp’, ‘auth’, ‘database’],
‘node_modules/ng2-charts/ng2-charts.js’: [‘ChartsModule’]
}
}),

Sorry for copy-pasting the code. Didn’t figure out how to include coding.

Hope it helps!

Interesting thank you. Also you may want to only include the packages that are causing you issues. 'node_modules/@ionic/cloud-angular/**'

I also tried that before switching to node_modules/** but it yielded the same error. For me including the entire node_modules directory is the only way it works for now.

I solved for ng2-cordova-oauth

edit
node_modules/@ionic/app-scripts/config/rollup.config.js
and add:

plugins: [
ngTemplate(),
commonjs({
include: [
‘node_modules/**’
],
namedExports: {
‘node_modules/ng2-cordova-oauth/core.js’: [‘CordovaOauth’,‘Facebook’,‘Google’] //and other providers you use
}
}),

For some reason, I installed the app-scripts beta and now it’s working for me without modifying the rollup.config.js…