Skip to content
Advertisement

syntax error when launching java script web project

I have a table that is being populated by firebase database values. When I launch the application, I obtain the following error: Uncaught SyntaxError SyntaxError: The requested module ‘https://www.gstatic.com/firebasejs/9.8.3/firebase-app.js’ does not provide an export named ‘child’ at (program)

Can someone provide a solution

HTML and JS code

JavaScript

Advertisement

Answer

You’re trying to import the Realtime Database functions from the wrong SDK.

Change the import to:

JavaScript

So firebase-database.js instead of firebase-app.js.

Advertisement