Angular 2 AOT - "Uncaught ReferenceError: Export is not defined error"

I'm having a problem running an Angular 2 app compiled for AoT with Rollup using instructions from the angular.io docs (link here )

The compilation process is fine as far as I can tell, although I get this as the only output:

โš ๏ธ   'default' is imported from external module 'rollup' but never used

'initializeApp' is not exported by 'node_modules/firebase/firebase-node.js'
'initializeApp' is not exported by 'node_modules/firebase/firebase-node.js'
'app' is not exported by 'node_modules/firebase/firebase-node.js'
'auth' is not exported by 'node_modules/firebase/firebase-node.js'
'database' is not exported by 'node_modules/firebase/firebase-node.js'
'database' is not exported by 'node_modules/firebase/firebase-node.js'

      

Build.js is created and I have index.html and other required files:

<!DOCTYPE html>
<html>
<head>
    <title>Ahead of time compilation</title>
    <base href="/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="dist/shim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.8.9/zone.min.js"></script>
</head>
<body>
    <my-app>Loading...</my-app>
</body>
<script src="dist/build.js"></script>
</html>
      

Run codeHide result


However, when I run my application in a browser, I get an Uncaught ReferenceError: no export defined .

Any suggestions on how to resolve it?

+3


source to share





All Articles