GatsbyJS/Netlify无法在mac os chrome上显示索引页

GatsbyJS/Netlify无法在mac os chrome上显示索引页,gatsby,netlify,Gatsby,Netlify,我通过netlify部署了我的自定义博客。 当我试图在mac OS Chrome上显示我的网站时,我遇到了一个问题 选中: 我检查了其他URL是否正常工作,例如,在Mac OS Chrome上。 我还检查了其他环境,如MacOSSafari、Windows10Chrome、iPhone Chrome和iPad Chrome 只是在Mac OS Chrome上不起作用 我得到了这个错误: index.jsx页面源代码: import React from 'react'; import { na

我通过netlify部署了我的自定义博客。
当我试图在mac OS Chrome上显示我的网站时,我遇到了一个问题

选中:
我检查了其他URL是否正常工作,例如,在Mac OS Chrome上。
我还检查了其他环境,如MacOSSafari、Windows10Chrome、iPhone Chrome和iPad Chrome

只是在Mac OS Chrome上不起作用

我得到了这个错误:

index.jsx页面源代码:

import React from 'react';
import { navigate } from 'gatsby-link';

const LandingPage = ({ data }) => {
  if (typeof window !== 'undefined') {
    navigate('/Landing');
  }
  return null;
};

export default LandingPage;
部署日志

11:08:23 PM: Build ready to start
11:08:25 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
11:08:25 PM: build-image tag: v3.7.0
11:08:25 PM: buildbot version: 4b67c14778907027e78150ff5560728bb44534d3
11:08:25 PM: Fetching cached dependencies
11:08:25 PM: Starting to download cache of 232.7MB
11:08:27 PM: Finished downloading cache in 1.940994162s
11:08:27 PM: Starting to extract cache
11:08:42 PM: Finished extracting cache in 15.319896727s
11:08:42 PM: Finished fetching cache in 17.346177205s
11:08:42 PM: Starting to prepare the repo for build
11:08:42 PM: Preparing Git Reference refs/heads/main
11:08:43 PM: Parsing package.json dependencies
11:08:45 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
11:08:45 PM: Starting build script
11:08:45 PM: Installing dependencies
11:08:45 PM: Python version set to 2.7
11:08:46 PM: Started restoring cached node version
11:08:50 PM: Finished restoring cached node version
11:08:50 PM: v12.18.0 is already installed.
11:08:52 PM: Now using node v12.18.0 (npm v6.14.4)
11:08:52 PM: Started restoring cached build plugins
11:08:52 PM: Finished restoring cached build plugins
11:08:52 PM: Attempting ruby version 2.7.1, read from environment
11:08:54 PM: Using ruby version 2.7.1
11:08:54 PM: Using PHP version 5.6
11:08:54 PM: Started restoring cached yarn cache
11:08:54 PM: Finished restoring cached yarn cache
11:08:55 PM: Started restoring cached node modules
11:08:55 PM: Finished restoring cached node modules
11:08:55 PM: Installing NPM modules using Yarn version 1.22.4
11:08:56 PM: yarn install v1.22.4
11:08:56 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
11:08:56 PM: [1/4] Resolving packages...
11:08:58 PM: success Already up-to-date.
11:08:58 PM: Done in 1.89s.
11:08:58 PM: NPM modules installed using Yarn
11:08:58 PM: Started restoring cached go cache
11:08:58 PM: Finished restoring cached go cache
11:08:58 PM: go version go1.14.4 linux/amd64
11:08:58 PM: go version go1.14.4 linux/amd64
11:08:58 PM: Installing missing commands
11:08:58 PM: Verify run directory
11:09:00 PM: ​
11:09:00 PM: ────────────────────────────────────────────────────────────────
11:09:00 PM:   Netlify Build                                                 
11:09:00 PM: ────────────────────────────────────────────────────────────────
11:09:00 PM: ​
11:09:00 PM: ❯ Version
11:09:00 PM:   @netlify/build 9.11.1
11:09:00 PM: ​
11:09:00 PM: ❯ Flags
11:09:00 PM:   apiHost: api.netlify.com
11:09:00 PM:   cacheDir: /opt/build/cache
11:09:00 PM:   deployId: 6057535730a250000754180b
11:09:00 PM:   mode: buildbot
11:09:00 PM:   testOpts:
11:09:00 PM:     silentLingeringProcesses: ''
11:09:00 PM: ​
11:09:00 PM: ❯ Current directory
11:09:00 PM:   /opt/build/repo
11:09:00 PM: ​
11:09:00 PM: ❯ Config file
11:09:00 PM:   No config file was defined: using default values.
11:09:00 PM: ​
11:09:00 PM: ❯ Context
11:09:00 PM:   production
11:09:01 PM: ​
11:09:01 PM: ────────────────────────────────────────────────────────────────
11:09:01 PM:   1. Build command from Netlify app                             
11:09:01 PM: ────────────────────────────────────────────────────────────────
11:09:01 PM: ​
11:09:01 PM: $ yarn build
11:09:01 PM: yarn run v1.22.4
11:09:01 PM: $ gatsby build
11:09:05 PM: success open and validate gatsby-configs - 0.050s
11:09:07 PM: success load plugins - 1.553s
11:09:07 PM: success onPreInit - 0.066s
11:09:07 PM: success delete html and css files from previous builds - 0.005s
11:09:07 PM: success initialize cache - 0.010s
11:09:07 PM: success copy gatsby files - 0.052s
11:09:07 PM: success onPreBootstrap - 0.025s
11:09:07 PM: success createSchemaCustomization - 0.158s
11:09:08 PM: success Checking for changed pages - 0.000s
11:09:08 PM: success source and transform nodes - 0.246s
11:09:08 PM: success building schema - 0.752s
11:09:08 PM: info Total nodes: 122, SitePage nodes: 31 (use --verbose for breakdown)
11:09:08 PM: success createPages - 0.087s
11:09:08 PM: success Checking for changed pages - 0.000s
11:09:09 PM: success createPagesStatefully - 0.126s
11:09:09 PM: success update schema - 0.046s
11:09:09 PM: success onPreExtractQueries - 0.001s
11:09:10 PM: success extract queries from components - 0.980s
11:09:10 PM: success write out redirect data - 0.001s
11:09:10 PM: success Build manifest and related icons - 0.311s
11:09:10 PM: success onPostBootstrap - 0.315s
11:09:10 PM: info bootstrap finished - 8.981s
11:09:10 PM: success run static queries - 0.526s - 3/3 5.70/s
11:09:11 PM: warning code block or inline code language not specified in markdown. applying generic code block
11:09:11 PM: warning unable to find prism language '=javascript' for highlighting. applying generic code block
11:09:11 PM: warning unable to find prism language '=c++' for highlighting. applying generic code block
11:09:11 PM: success run page queries - 0.570s - 35/35 61.36/s
11:09:11 PM: success write out requires - 0.006s
11:10:00 PM: success Building production JavaScript and CSS bundles - 49.330s
11:10:01 PM: success Rewriting compilation hashes - 0.003s
11:10:21 PM: success Building static HTML for pages - 20.457s - 35/35 1.71/s
11:10:21 PM: success Generating image thumbnails - 71.232s - 9/9 0.13/s
11:10:21 PM: success onPostBuild - 0.002s
11:10:21 PM: info Done building in 80.281926306 sec
11:10:22 PM: Done in 80.79s.
11:10:22 PM: ​
11:10:22 PM: (build.command completed in 1m 21.1s)
11:10:22 PM: ​
11:10:22 PM: ────────────────────────────────────────────────────────────────
11:10:22 PM:   2. Deploy site                                                
11:10:22 PM: ────────────────────────────────────────────────────────────────
11:10:22 PM: ​
11:10:22 PM: Starting to deploy site from 'public'
11:10:22 PM: Creating deploy tree 
11:10:22 PM: Creating deploy upload records
11:10:22 PM: 55 new files to upload
11:10:22 PM: 0 new functions to upload
11:10:23 PM: Site deploy was successfully initiated
11:10:23 PM: ​
11:10:23 PM: (Deploy site completed in 1.8s)
11:10:24 PM: ​
11:10:24 PM: ────────────────────────────────────────────────────────────────
11:10:24 PM:   Netlify Build Complete                                        
11:10:24 PM: ────────────────────────────────────────────────────────────────
11:10:24 PM: ​
11:10:24 PM: (Netlify Build completed in 1m 23.1s)
11:10:24 PM: Caching artifacts
11:10:24 PM: Started saving node modules
11:10:24 PM: Finished saving node modules
11:10:24 PM: Started saving build plugins
11:10:24 PM: Finished saving build plugins
11:10:24 PM: Started saving yarn cache
11:10:24 PM: Finished saving yarn cache
11:10:24 PM: Started saving pip cache
11:10:24 PM: Starting post processing
11:10:24 PM: Finished saving pip cache
11:10:24 PM: Started saving emacs cask dependencies
11:10:24 PM: Post processing - HTML
11:10:24 PM: Finished saving emacs cask dependencies
11:10:24 PM: Started saving maven dependencies
11:10:24 PM: Finished saving maven dependencies
11:10:24 PM: Started saving boot dependencies
11:10:24 PM: Finished saving boot dependencies
11:10:24 PM: Started saving rust rustup cache
11:10:24 PM: Finished saving rust rustup cache
11:10:24 PM: Started saving go dependencies
11:10:24 PM: Finished saving go dependencies
11:10:24 PM: Build script success
11:10:25 PM: Mixed content detected in: /posts/language/c++/시작글/index.html
11:10:25 PM: --> insecure img urls:
11:10:25 PM:   - http://image.aladin.co.kr/product/9799/74/letslook/S262535853_f.jpg
11:10:27 PM: Post processing - header rules
11:10:27 PM: Post processing - redirect rules
11:10:27 PM: Post processing done
11:10:28 PM: Site is live ✨
11:11:23 PM: Finished processing build request in 2m58.535750784s

我所有的源代码都是。

我在Chrome Mac OS上运行该项目时,甚至在提供的URL中都没有看到任何问题。然而,屏幕截图中可能出现的问题是组件导入不好<代码>和
导航
应直接从盖茨比导入,而不是从
盖茨比链接
,如中所示

应用于您的代码:

import React from 'react';
import { navigate } from 'gatsby';

const LandingPage = ({ data }) => {
  if (typeof window !== 'undefined') {
    navigate('/Landing');
  }
  return null;
};

export default LandingPage;

我在Chrome Mac操作系统中运行它,我被重定向到/按预期登陆我使用的是m1 silicon Mac。你试过在m1硅mac上访问我的网页吗?没有,我没有运行m1。不管怎么说,这很奇怪。您是否尝试了正确导入的代码片段?还可以尝试升级盖茨比