我从 Firebase 收到此错误,今天我将 Analytics 添加到我的项目中,现在登录页面在控制台中显示此错误。
helpers.ts:72 GET https://www.googletagmanager.com/gtag/js?l=dataLayer net::ERR_BLOCKED_BY_CLIENT
Run Code Online (Sandbox Code Playgroud)
我没有在我的index.html中导入GTAG(我正在使用React)这个东西
<script async src="https://www.googletagmanager.com/gtag/js"></script>
Run Code Online (Sandbox Code Playgroud)
因为我没有使用它。
我的 Firebase 配置文件如下所示
import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
import "firebase/analytics";
// Your web app's Firebase configuration
var firebaseConfig = {
//the usual
measurementId: "G-something",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
export const db = firebase.firestore();
export const firestore = firebase.firestore;
export const analytics = firebase.analytics;
Run Code Online (Sandbox Code Playgroud)
登陆页面
import { analytics } from "../configs/fbConfig";`
useEffect(() => {
analytics().setCurrentScreen(window.location.pathname); // sets `screen_name` …Run Code Online (Sandbox Code Playgroud) javascript google-analytics firebase reactjs firebase-analytics
我遇到了这个问题,无法在 Firestore 中使用我的数据进行 startAfter 工作。\n我给出了这个问题的两个示例,第一张图片是在它工作时使用属性(createdAt)进行过滤的,第二次传递整个文档返回空并且无法使 forEach 循环数据
\n有人知道这是怎么回事吗?这些文件没有任何复杂的信息,名称,创建日期,所有用于测试的数字。
\n如果有人遇到这个问题,请帮我解答,我几天前刚刚开始学习 Firebase。\n提前致谢:)
\n// getting the data\nconst response = await db\n .collection("apis")\n .orderBy("createdAt")\n .limit(3)\n .get();\n const dataSend = [];\n response.forEach((document) => {\n dataSend.push(document.data());\n });\n//triggering the next data load\n\n const getMore = async () => {\n const limit = 3;\n const last = apis[apis.length - 1]; // last document\n console.log(last); // {name: "3", description: "3", createdAt: t, url: "3", authorId: 123123,\xc2\xa0\xe2\x80\xa6}\n\n try {\n const response = await db\n .collection("apis")\n .limit(limit)\n .orderBy("createdAt")\n …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 #app 设置为 100% 高度,但无法实现。div #app 不被视为 Body 的子级吗?我每次都会遇到这个问题,每次我都必须以不同的方式解决。
有没有办法完全避免这种情况的发生呢?CSS:
* {
margin: 0;
padding: 0;
font-family: "Nunito";
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
height: 100%;
}
body {
transition: background 0.25s ease-in-out;
min-height: 100%;
}
#app {
max-height: 100%;
min-width: 100%;
position: relative;
}
Run Code Online (Sandbox Code Playgroud)