Uncaught ReferenceError: System is not defined
maurya2711 opened this issue · comments
Sharad Maurya commented
Anders Nilsson commented
If System
is not defined it has not been loaded. Do you have a script tag in your html like below?
<script src="https://cdn.jsdelivr.net/npm/systemjs/dist/system.js"></script>
Bos, Pierry commented
I have the same error.
<script src="https://cdn.jsdelivr.net/npm/systemjs/dist/system.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.1/firebase-messaging.js"></script>
<script>SystemJS.import('./js/nofity.js').catch(console.error);</script>
and the error is:
Uncaught SyntaxError: Unexpected token 'export' (at firebase-app.js:1590:1)
firebase-messaging.js:1 Uncaught SyntaxError: Cannot use import statement outside a module (at firebase-messaging.js:1:1)
ReferenceError: SystemJS is not defined at index.php:13:1
What am I doing wrong?
Anders Nilsson commented
Try to use System.import
instead of SystemJS.import
there seem to be some error also in the firebase code that I don't know anything about.