I'm trying to use firebase to make contact form work.The project is working with webpack. Following all tutorials and documentation I put the code
import { initializeApp } from "firebase/app";
const firebaseConfig = {
apiKey: "LKJidsdkjoeiflkdsjfsidfjlsdisj",
authDomain: "sdfklsdkj.firebaseapp.com",
projectId: "sdfklsdkj",
storageBucket: "sdfklsdkj.appspot.com",
messagingSenderId: "1068439125174",
appId: "1:1132132332:web:4ecfb3a687c92917617a17"
};
const app = initializeApp(firebaseConfig);nter code here
to special form.js file in the bottom of HTML:
<script src="./src/assets/form.js"></script>
<script src="./dist/main.js"></script>
And firefox console gives me this error: import declarations may only appear at top level of a module.
I tried to solve the issue and add type="module" in the script. And got another error in console:
Error resolving module specifier “firebase/app”. Relative module specifiers must start with “./”, “../” or “/”. How to solve this issue?