theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.15k stars 2.05k forks source link

7.4.0 Rocket Loader造成 Chrome无法正常显示内容 #1170

Closed ProfessorX closed 5 years ago

ProfessorX commented 5 years ago

I agree and want to create new issue

确认


Expected behavior

Chrome浏览器能够正常显示首页,跟7.2.0时候一样。

Actual behavior

Chrome浏览器最新版本无法正常显示首页内容,为白板一片。

切换成Edge浏览器能够正常显示内容!

Steps to reproduce the behavior

  1. git clone https://github.com/ProfessorX/hexo-source.git
  2. theme-next --> stable 7.4.0
  3. hexo g
  4. hexo deploy
  5. **这个问题在本地4000端口测试不出来,显示一切正常。但是推到github之后用Chrome浏览器打开就不正常了。

Hexo Information

Package dependencies Information

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.9.0"
  },
  "dependencies": {
    "hexo": "^3.9.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-renderer-marked": "^1.0.1",
    "hexo-server": "^0.3.3"
  }
}

Hexo Version

hexo: 3.9.0
hexo-cli: 2.0.0
os: Windows_NT 10.0.18363 win32 x64
node: 12.10.0
v8: 7.6.303.29-node.16
uv: 1.31.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 72
nghttp2: 1.39.2
napi: 4
llhttp: 1.1.4
http_parser: 2.8.0
openssl: 1.1.1c
cldr: 35.1
icu: 64.2
tz: 2019a
unicode: 12.1

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Masdar Wireless
subtitle: To Infinity and Beyond!
description: Shut Up and Get Rich.
keywords:
author: Abraham Xiao
language: zh-CN
timezone: Asia/Shanghai

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yxiao.org
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type:

NexT Configuration

这个去https://github.com/ProfessorX/theme-next 看吧。我的配置在_config.yml 里面。

Other Information

Browser

Chrome 77.0.3865.75 Edge 看不到版本号 Windows 版本 10.0.18363.356

welcome[bot] commented 5 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

ProfessorX commented 5 years ago

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.baidu.com/error.html with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.


我前端朋友帮我看是这个原因。

不知道如何破解。

页面不存在_百度搜索
Cross-Origin Read Blocking (CORB) - Chrome Platform Status
Cross-Origin Read Blocking (CORB) is an algorithm that can identify and block dubious cross-origin resource loads in web browsers before they reach the web page. CORB reduces the risk of leaking sensitive data by keeping it further from cross-origin web pages. In most browsers, it keeps such data out of untrusted script execution contexts. In browsers with Site Isolation, it can keep such data out of untrusted renderer processes entirely, helping even against side channel attacks like Spectre.
ProfessorX commented 5 years ago

Update:

next 换回7.2.0之后主页显示正常了。

感觉是7.4.0中间有js文件有问题。


备注:我没有切7.3.0版本,7.4.0版本网页用的stable, 7.2.0用的之前发的我页面下的theme-next.

https://github.com/ProfessorX/theme-next

GitHub
ProfessorX/theme-next
Contribute to ProfessorX/theme-next development by creating an account on GitHub.
1v9 commented 5 years ago

这不是 NexT 的问题,尝试使用国产低 chrome 内核的浏览器检测你的 7.4.0 部署或者排查你使用的 CloudFlare 服务。

support[bot] commented 5 years ago

:wave: @ProfessorX, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.

stevenjoezhang commented 5 years ago

我用macOS上的Chrome试了下,可以正常访问…… 不太清楚报错信息为何会指向https://www.baidu.com/error.html

ProfessorX commented 5 years ago

@stevenjoezhang

正常访问是因为我网站白板一个礼拜了,刚才实在受不了于是切了7.2.0主题的next一切正常。

如何重现我也说了,我所有源码也public了。

How to reproduce the problem: git clone https://github.com/ProfessorX/hexo-source.git theme-next --> stable 7.4.0 hexo g hexo deploy **这个问题在本地4000端口测试不出来,显示一切正常。但是推到github之后用Chrome浏览器打开就不正常了。


Update:

next 换回7.2.0之后主页显示正常了。

感觉是7.4.0中间有js文件有问题。
GitHub
ProfessorX/hexo-source
Contribute to ProfessorX/hexo-source development by creating an account on GitHub.
ProfessorX commented 5 years ago

我用macOS上的Chrome试了下,可以正常访问…… 不太清楚报错信息为何会指向https://www.baidu.com/error.html

你拉到最下面看下theme 是不是7.2.0 7.2.0 我这边内网浏览器也OK啊。


你们拉我source 源码,然后主题配 7.4.0的,再推到你们自己 github.io试试。

我是懒得再切一次7.4.0了 (划掉)

算了还是再切一次吧7.4.0

ProfessorX commented 5 years ago

这不是 NexT 的问题,尝试使用国产低 chrome 内核的浏览器检测你的 7.4.0 部署或者排查你使用的 CloudFlare 服务。

大哥,做过实验吗?

NEXT

  1. 7.2.0的时候一切正常。
  2. 我电脑最近重装,硬盘全部格式化,网站啥的没太多备份于是 ·git clone theme-next· 拉的7.4.0版本的,然后hexo g hexo s
  3. 部署之后发现用Chrome开就白板了。
  4. 这中间我域名没动,CloudFlare没动,source 目录下面也没怎么动。就换了Next 的最新版本。
  5. 然后刚刚我切 7.2.0 主页又能正常显示了。
  6. 这还不是主题中间哪个东西除了问题?

··· Start processing INFO Files loaded in 1.8 s INFO Deleted: js/exturl.js INFO Deleted: js/affix.js INFO Deleted: js/scroll-cookie.js INFO Deleted: lib/velocity/velocity.ui.js INFO Deleted: js/js.cookie.js INFO Deleted: lib/jquery/index.js INFO Deleted: js/scrollspy.js INFO Deleted: lib/velocity/velocity.js INFO Deleted: js/post-details.js ···

这是切740 删除掉的一些文件。

ProfessorX commented 5 years ago

Update again: @stevenjoezhang

我切740了。

你再用Chrome 开首页康康?

ProfessorX commented 5 years ago

微信截图_20190920105858

忘了Github可以直接传图了。

大家伙康康,评评理。

ProfessorX commented 5 years ago

微信截图_20190920110118

Version.

stevenjoezhang commented 5 years ago

正常访问是因为我网站白板一个礼拜了,刚才实在受不了于是切了7.2.0主题的next一切正常。

我佛辣,您这真是迷惑行为啊,白板一个礼拜了不开Issue,开了Issue之后又切换为正常版本😂 这让大家怎么开展工作嘛。 可以加一下telegram群,交流更方便:https://t.me/theme_next_chinese

Telegram
NexT – 中文群
一款风格优雅的高质量 Hexo 主题
stevenjoezhang commented 5 years ago

这个问题在本地4000端口测试不出来,显示一切正常。但是推到github之后用Chrome浏览器打开就不正常了。

巧了,我git clone https://github.com/ProfessorX/ProfessorX.github.io然后http-server也一切正常。

ProfessorX commented 5 years ago

正常访问是因为我网站白板一个礼拜了,刚才实在受不了于是切了7.2.0主题的next一切正常。

我佛辣,您这真是迷惑行为啊,白板一个礼拜了不开Issue,开了Issue之后又切换为正常版本😂 这让大家怎么开展工作嘛。 可以加一下telegram群,交流更方便:https://t.me/theme_next_chinese

TelegramNexT – 中文群一款风格优雅的高质量 Hexo 主题

正所谓忍无可忍,无需再忍。

这个issue本地是OK的,因为我真的不懂前端所以只能发上来给大佬们解决了。

向大佬低头。

Telegram
NexT – 中文群
一款风格优雅的高质量 Hexo 主题
stevenjoezhang commented 5 years ago

看上去就是CloudFlare的Rocket Loader造成的问题,另见https://github.com/theme-next/hexo-theme-next/issues/1147 这个bug与NexT主题无关,建议关闭此服务

ProfessorX commented 5 years ago

Disabled the rocket loader.

Issue closed.

撒花?


有没有我全都要的方案?

stevenjoezhang commented 5 years ago

有没有我全都要的方案?

似乎没有:

Rocket Loader 会将您所有JavaScript 的加载一直推迟到渲染之后再进行,从而优先处理您网站的内容(文本、图像、字体等)。

这从原理上破坏了NexT主题设计好的加载方式😢

ProfessorX commented 5 years ago

c9d3e7b8


不对啊。

为啥之前720的时候一切正常,好奇ing

stevenjoezhang commented 5 years ago

因为7.4.0把jQuery换掉了,也调整了一些脚本的加载顺序

stevenjoezhang commented 2 years ago

已在 https://github.com/theme-next/hexo-theme-next/pull/1470 中修复