Skip to content
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

Use of unexported auth property #545

Closed
olostan opened this issue Sep 21, 2016 · 4 comments
Closed

Use of unexported auth property #545

olostan opened this issue Sep 21, 2016 · 4 comments

Comments

@olostan
Copy link

olostan commented Sep 21, 2016

When trying to bundle with rollup angularfire2 (ionic 2 app) I got such error:

Error: Module myproject/node_modules/angularfire2/node_modules/firebase/firebase-browser.js does not export auth (imported by myproject/node_modules/angularfire2/auth/firebase_sdk_auth_backend.js)

Seems it is because import {auth} from 'firebase' and auth is not exported. Using angularfire2 version 2.0.0-beta.5

@olostan
Copy link
Author

olostan commented Sep 21, 2016

Thnx to @ivoviz, @orangesoup found workaround:

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

  1. Add useScript: false into configuration
  2. change commonjs() to:
commonjs(
    {
        include: [
        'node_modules/rxjs/**',
        'node_modules/angularfire2/**',
        'node_modules/firebase/**'
        ],
        namedExports: {
        'node_modules/angularfire2/node_modules/firebase/firebase.js': ['initializeApp', 'auth', 'database'],
        'node_modules/angularfire2/node_modules/firebase/firebase-browser.js': ['initializeApp', 'auth', 'database']

        }
    }
 )

@jeffbcross
Copy link
Contributor

Yep, namedExports is the solution for now.

@chrste90
Copy link

Hi,

i did the same and now it works, thanks.
But i wouldn't change the original rollup-config, you can just use your own, like here:
#565 (comment)

@dr1v3
Copy link

dr1v3 commented Sep 29, 2016

@olostan , it should be useStrict: false, not useScript: false!

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

4 participants