Angularfire: Unexpected token export

Created on 8 May 2017  路  5Comments  路  Source: angular/angularfire

Hi Guys, I'm experiencing a similar issue to this 543 in that I'm receiving unexpected token export.

If I check the console the line is thrown by my app,js file

Uncaught SyntaxError: Unexpected token export
at Object. (app.js:155)
at __webpack_require__ (polyfills.js:53)

When I check my app.js file around that area I can see that firebase is attempting to use 'export * from';

eval("export * from './database/database';\nexport * from './database/firebase_list_factory';\nexport * from './database/firebase_list_observable';\nexport * from './database/firebase_object_factory';\nexport * from './database/firebase_object_observable';\nexport * from './database/query_observable';\nexport * from './database/database.module';\n//# sourceMappingURL=database.js.map//# sourceMappingURL=data:application/json;charset=utf-

I am currently running:
Angular 4.1.1
Firebasee 3.9.0
AngularFire2 @ 4.0.0-rc.0
Node.js using WebPack 1.15.0

My ts.config file is as follows, compiling to es6, everything was working fine in my application environment prior to trying to move to Angular 4 and AngularFire2.

My tsconfig file is as follows:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "rootDir": "./src",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "typeRoots": [ "./node_modules/@types" ],
    "types": [ "jasmine", "node", "core-js", "protractor"]
  },
  "exclude": [
    "node_modules"
  ]
}

I'm importing the following modules into my app.module file.

import {AngularFireModule} from 'angularfire2';
import {AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable} from 'angularfire2/database';

Importing like this..

   imports: [
        AngularFireModule.initializeApp(firebaseConfig, 'my-app'),
        AngularFireDatabaseModule,
        AngularFireAuthModule,
];

In the previous issue a umd file was not being used because of a spelling mistake in the package.json file, I can verify this isn't here. Also, someone mentioned that webpack 1 only carries out some tasks and webpack 2 others, is my working environment not valid?

Any help appreciated. Thanks.

All 5 comments

same issue here :(

same issue

Facing the same issue

Solved it,
Actually, the problem was with webpack version 1, after updating to webpack 2 the problem is fixed.

Closing, @ziaukhan offered solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cre8 picture cre8  路  3Comments

martinyoussef picture martinyoussef  路  3Comments

KLiFF2606 picture KLiFF2606  路  3Comments

Leanvitale picture Leanvitale  路  3Comments

jteplitz picture jteplitz  路  3Comments