Я пытаюсь импортировать эти данные из файла seed. js, и по какой-то причине firebase выдает эту ошибку. Я не уверен, что я забыл установить файл или мне не хватает определенного тега скрипта в индексе. html, но по какой-то причине не знаю, почему он не работает
Here is my index.js file code
import React from 'react';
import ReactDOM from 'react-dom';
import { GlobalStyles } from './global-styles';
import { App } from './app';
import { FirebaseContext } from './context/firebase';
import { seedDatabase } from './seed';
const config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: ""
};
const firebase = window.firebase.initializeApp(config);
seedDatabase(firebase);
ReactDOM.render(
<FirebaseContext.Provider value={{ firebase: window.firebase }}>
<GlobalStyles />
<App />
</FirebaseContext.Provider>, document.getElementById('root')
);
Вот начальное число. js данные файла
export function seedDatabase(firebase) {
function getUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const piece = (Math.random() * 16) | 0;
const elem = c === 'x' ? piece : (piece & 0x3) | 0x8;
return elem.toString(16);
});
}
firebase.firestore().collection('series').add({
id: getUUID(),
title: 'Something',
description: 'Example'
});