我一直试图在Google平台上部署用盖茨比( Gatsby )制作的静态应用。
我的麻烦在于app.yaml文件。
以下是我迄今所做的工作:
1. Made a Gatsby project.
2. Gatsby build.
3. Uploaded the public folder to a GCS bucket.
4. Copied it to the Google Cloud Shell using the following command: gsutil rsync -r gs://static-site-test ./gatsby-test
5. cd gatsby-
我已经将gatsby-plugin-layout安装到我的项目文件中,创建了src/layouts/index.js,并将gatsby-plugin-layout添加到gatsby-config.js中。Gatsby应用程序编译并可以在开发服务器上服务,但是通过我的布局组件的console.log输出,我看到布局组件仍然在每个页面加载上重新挂载。我的目标是让布局组件在反应应用的过程中只挂载一次。
src/layouts/index.js
import React from "react"
import Header from "../components/header&
我正在一个无头eCommerce网站上使用,。和.
如果我使用npm run dev运行这个应用程序,我可以从内容中看到所有的graphql数据。
这就是我的意思,所有的graphql数据都可以在本地获取,甚至可以在npm run build上获取,但是它并不能在生产中编译所有的graphql数据。
以下是在上构建盖茨比应用程序时的一些日志。
日志上说没有错误,但我可以从那里看到一些警告。
下面是graphql查询,它在本地环境中运行良好。
const HomePage = ({ data }) => {
console.log('slider in in
我克隆了一个gatsby应用程序,并在运行开发服务器时:
$ gatsby develop
我收到一个错误:
以上错误发生在应用程序中的组件中: StoreStateProvider中
React will try to recreate this component tree from scratch using the error boundary you provided, App.
ERROR
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that metho
我有一个GatsbyJS项目,我试图使用钩子,但是我得到了这个错误。
我做的第一件事是删除node_modules文件夹和package.json.lock文件,然后再次安装npm,但没有工作。
查看反应文件:-
--据我所知,您可能有与DOM不匹配的版本,并对DOM作出反应。据我所知,我没有错误匹配的版本。
,您可能违反了Hooks.的规则--据我所知,我使用的是组件
--您可能在同一个应用程序中有多个app副本。我试过了,正如React文档所显示的那样:-
// Add this in node_modules/react-dom/index.js
window.React1 = re
目标:尝试使用盖茨比创建一个简单的博客
成果:
- Expected Outcome: Things should go as defined in the tutorial guide
- Actual Outcome: Getting Dependency tree error in step(s) & Also a warning message like `34 vulnerabilities (11 moderate, 23 high)` whenever installing something using npm in this project
我创建了hello world GatsbyJS应用程序,然后添加了typescript插件,立即得到错误消息"React is not defined“。我完成了添加"import * as React from‘react’“的步骤;但在/cache/app.js中仍然抛出了相同的错误。我不确定下一步该怎么做。 Hello world GatsybyJS:https://www.gatsbyjs.org/tutorial/part-zero/#create-a-gatsby-site 添加Typescript:https://www.gatsbyjs.org/packag
我使用情感在我的项目中制作样式组件,现在它给我带来了问题。我是这样安装的:
npm i @emotion/react @emotion/styled gatsby-plugin-emotion
例如,如果我想在Header组件中使用它,我会这样做:
import React from 'react';
import { Link } from 'gatsby';
import Navegacion from './navegacion';
import { jsx, css } from '@emotion/react';
co
我正在尝试使用GatsbyJS创建一个博客。我遵循以下教程 https://www.gatsbyjs.org/docs/recipes/#optimizing-and-querying-images-in-post-frontmatter-with-gatsby-image 博客包含标题、特色图片和文本。 MDX-file结构如下所示。 ---
title: My First Post
featuredImage: ./corgi.png
---
Post content... 而且,gatsby-node.js文件中的代码如下 exports.createPages = async ({
当我在我的gatsby项目中使用Gatsby构建时,我得到了以下错误。如果我在另一个项目中遇到了同样的问题,但另一个项目使用相同的sass语法顺利运行,我不会对此感到如此恼火。所以这不可能是一个粗鲁的问题。我想一定是我的包里有什么东西。 Generating development JavaScript bundle failed
@import "bulma"
^
Media query expression must begin with '('
in /Users/kristijan/Documents/00_clients/
我正在使用Gatsby/React构建一个站点,该站点在构建时向WordPress服务器发送API调用,以便检索博客帖子列表。虽然'gatsby-build‘和'gatsby develop’命令都在本地工作,但在Netlify上部署站点时,部署总是失败的:
error "gatsby-source-wordpress" threw an error while running the sourceNodes lifecycle:
Cannot convert undefined or null to object
显然,它每次都无法从WordPress检索A