gatsby

Netlify is displaying the html version of my Gatsby website

给你一囗甜甜゛ 提交于 2020-07-08 10:23:46
问题 The website build is at https://5efbc255ca51be00080b5219--epic-raman-086510.netlify.app/ . It looks like the javascript isn't running, and only the html version(supposed to only be displayed to search engines) is being displayed. It kinda looks like it might only be the home page. You can visit theWebsiteBuildLink/publications , or theWebsiteBuildLink/publications to see it working for other pages. I've noticed the tab at the top of my browser displays a loading animation indefinately Update

Netlify is displaying the html version of my Gatsby website

僤鯓⒐⒋嵵緔 提交于 2020-07-08 10:23:23
问题 The website build is at https://5efbc255ca51be00080b5219--epic-raman-086510.netlify.app/ . It looks like the javascript isn't running, and only the html version(supposed to only be displayed to search engines) is being displayed. It kinda looks like it might only be the home page. You can visit theWebsiteBuildLink/publications , or theWebsiteBuildLink/publications to see it working for other pages. I've noticed the tab at the top of my browser displays a loading animation indefinately Update

Gatsby: React conditional rendering based on window.innerWidth misbehaving

£可爱£侵袭症+ 提交于 2020-07-06 12:10:13
问题 Conditional rendering of components based on window.innerWidth seems to not work as intended just in the production build of Gatsby based website. The hook I am using to check the viewport's width, with the additional check for the window global to avoid Gatsby-node production build errors, is the following: import { useState, useEffect } from 'react' const useWindowWidth = () => { const windowGlobal = typeof window !== 'undefined' if(windowGlobal) { const [width, setWidth] = useState(window

Gatsby: React conditional rendering based on window.innerWidth misbehaving

泪湿孤枕 提交于 2020-07-06 12:09:40
问题 Conditional rendering of components based on window.innerWidth seems to not work as intended just in the production build of Gatsby based website. The hook I am using to check the viewport's width, with the additional check for the window global to avoid Gatsby-node production build errors, is the following: import { useState, useEffect } from 'react' const useWindowWidth = () => { const windowGlobal = typeof window !== 'undefined' if(windowGlobal) { const [width, setWidth] = useState(window

Gatsby: React conditional rendering based on window.innerWidth misbehaving

亡梦爱人 提交于 2020-07-06 12:09:18
问题 Conditional rendering of components based on window.innerWidth seems to not work as intended just in the production build of Gatsby based website. The hook I am using to check the viewport's width, with the additional check for the window global to avoid Gatsby-node production build errors, is the following: import { useState, useEffect } from 'react' const useWindowWidth = () => { const windowGlobal = typeof window !== 'undefined' if(windowGlobal) { const [width, setWidth] = useState(window

Gatsby: Set background image with CSS

ε祈祈猫儿з 提交于 2020-07-06 09:01:20
问题 Looking at the Gatsby docs, they suggest that you can reference background images like you would anywhere else: .image { background-image: url(./image.png); } What they don't cover is where these images should live. I've tried placing the image directory in the src folder, in the layout folder, and in the root folder, but I keep getting the error: Loader /Users/username/Sites/my-app/node_modules/url/url.js?{"limit":10000,"name":"static/[name].[hash:8].[ext]"} didn't return a function @ ./~

Gatsby: Set background image with CSS

泄露秘密 提交于 2020-07-06 09:01:11
问题 Looking at the Gatsby docs, they suggest that you can reference background images like you would anywhere else: .image { background-image: url(./image.png); } What they don't cover is where these images should live. I've tried placing the image directory in the src folder, in the layout folder, and in the root folder, but I keep getting the error: Loader /Users/username/Sites/my-app/node_modules/url/url.js?{"limit":10000,"name":"static/[name].[hash:8].[ext]"} didn't return a function @ ./~

gatsbyjs, reactjs - why components are rendering twice and images do not appear?

一曲冷凌霜 提交于 2020-06-29 05:44:06
问题 I am new to gatsbyjs and using v2. I've 3 components - loader, header and layout. layout.js import React from "react" import Helmet from 'react-helmet' import { StaticQuery, graphql } from 'gatsby' import Header from "./header" import Loader from "./loader" import 'bootstrap/dist/css/bootstrap.min.css' import "./layout.module.css" const Layout = ({ children }) => ( <StaticQuery query={graphql` query SiteTitleQuery { site { siteMetadata { title menuLinks { name link } } } } `} render={data =>

Make graphql query outside a JSX component in Gatsby

纵饮孤独 提交于 2020-06-29 04:30:28
问题 I have a .ts (not .tsx ) file which just exports a json object like const obj = { img1: gql_img1, img2: gql_img2 } I want gq1_img1 and gq1_img2 to be the results of a graphql query I found a solution which uses Apollo Client, but it doesn't look like they're using Gatsby and I don't think Gatsby uses a client. The problem with using useStaticQuery is that it's a hook, if I try to use it like in the snippet below, I get "Error: Invalid hook call. Hooks can only be called inside of the body of

can't query results of graphql query because am using 2 arrays within each other

最后都变了- 提交于 2020-06-28 03:48:09
问题 Here is my map function, I am using react with gatsby. when I run my graphiql browser, (an IDE graphql playground) I get group as an array, and edges is also an array. the query is a static query and the mapping function is inside of a class based react component {group.map(({ edges }) => { console.log(group); edges.map(index => { return <p>Hello</p> }); })} However, the p tags are not displaying anything, but if I console.log("hello") it consoles hello 4 times, anyone got any ideas? I am a