Closed noraj closed 1 year ago
i have same problem too
@dimaslanjaka Have you a public repository with the error happening?
i have same problem too. i change the package manager for PNPM solved the problem
I also encountered this problem. Has it been solved?
i solved this problem by installing version 6.0.0.
npm i hexo@6.0.0
@dimaslanjaka Have you a public repository with the error happening?
I have this problem too https://github.com/MCSeekeri/sciadv/runs/5655539928?check_suite_focus=true
I also encountered this problem. Has it been solved?
No @lzkids
i solved this problem by installing version 6.0.0.
I already have v6.0.0 as stated in package.json @dimaslanjaka
@MCSeekeri thanks for sharing the URL
@dimaslanjaka Have you a public repository with the error happening?
I have this problem too https://github.com/MCSeekeri/sciadv/runs/5655539928?check_suite_focus=true
My fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/actions
npm i hexo@6.0.0
6.1.0
to 6.0.0
in package.json
{
"hexo": {
"version": "6.0.0"
}
}
if still get errors.
delete package-lock.json
and node_modules
then reinstall with npm install hexo@6.0.0
fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/runs/5657131614?check_suite_focus=true
replace hexo version
6.1.0
to6.0.0
inpackage.json
Nice to know, thk for the workaround. It confirms 6.1.0 has introduced a bug and need to be fixed.
Relevant pull request: https://github.com/hexojs/hexo/pull/4869
- install hexo 6.0.0
npm i hexo@6.0.0
* replace hexo version `6.1.0` to `6.0.0` in `package.json`
{ "hexo": { "version": "6.0.0" } }
if still get errors. delete
package-lock.json
andnode_modules
then reinstall withnpm install hexo@6.0.0
fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/runs/5657131614?check_suite_focus=true
thk
@noraj @dimaslanjaka @kkfive @MCSeekeri @lzkids
How about below workaround?
// In your hexo project
// for hexo 6.1.0
$ npm install js-yaml@4.1.0
// for hexo 6.0.0
$ npm install js-yaml@4.0.0
I think this is probably effective. (I'm not sure this workaround has a bad side-effect or not. I think may be no bad side-effect... but not sure.)
P.S:
I have been able to reproduce this issue with https://github.com/hexojs/hexo-generator-category But, I think we need more time to fix this issue.
How about below workaround?
// In your hexo project // for hexo 6.1.0 $ npm install js-yaml@4.1.0
It is already js-yaml 4.1.0 that is shipped with hexo 6.1.0
https://github.com/hexojs/hexo/blob/8d2102745fb804278238df4ba7832b871a78d899/package.json#L51
It's already what is in my package-lock.json
. However I had to change this:
"hexo": {
- "version": "6.0.0"
+ "version": "6.1.0"
},
"dependencies": {
"hexo": "^6.1.0",
It is already js-yaml 4.1.0 that is shipped with hexo 6.1.0
Yes, I know.
Not sure, but I assume this error seems incorrect version resolving of js-yaml
.
// git clone & checkout
$ git clone https://github.com/hexojs/hexo-generator-category.git
$ git checkout -b issue-4917 f51949900e5dbd15902b45fe4399afb634d54b21
$ git log --oneline
f519499 (HEAD -> issue-4917) chore(ci): migrate travisCI to GitHubActions (#70)
f233a38 chore(deps): bump hexo-pagination from 1.0.0 to 2.0.0 (#46)
fadee1a Upgrade to GitHub-native Dependabot (#45)
// hexo@5.4.0 will be installed
$ npm install
// install hexo@6.1.0
$ npm install hexo@6.1.0
// run test
$ npm run test
> hexo-generator-category@1.0.0 test
> mocha test/index.js
YAMLException: Specified list of YAML types (or a single Type object) contains a non-Type object.
at /mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/node_modules/js-yaml/lib/schema.js:104:13
at Array.forEach (<anonymous>)
at Schema.extend (/mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/node_modules/js-yaml/lib/schema.js:102:12)
at Object.<anonymous> (/mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/lib/plugins/renderer/yaml.js:5:36)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
Here is the dependency tree after exec How to reproduce?
section. Certainly, hexo@6.1.0
depends on js-yaml@4.1.0
and it seems no problem.
$ npm list js-yaml
hexo-generator-category@1.0.0 /mnt/c/Users/username/hexo/hexo-generator-category
├─┬ coveralls@3.1.1
│ └── js-yaml@3.14.1
├─┬ eslint@7.32.0
│ ├─┬ @eslint/eslintrc@0.4.3
│ │ └── js-yaml@3.14.1 deduped
│ └── js-yaml@3.14.1 deduped
├─┬ hexo@6.1.0
│ ├─┬ hexo-front-matter@3.0.0
│ │ └── js-yaml@4.1.0
│ └── js-yaml@4.1.0 <- should be use this. but not actually used???
├─┬ mocha@8.4.0
│ └── js-yaml@4.0.0
└─┬ nyc@15.1.0
└─┬ @istanbuljs/load-nyc-config@1.1.0
└── js-yaml@3.14.1 deduped
But, as you know exception occurs when run test. I wrote at the beginning of this comment, I'm not sure but it seems the require('js-yaml')
resolves older than the 4.0.0
version of js-yaml.
.
I don't know which is the cause hexo
, npm
, or js-yaml
.
As I wrote in https://github.com/hexojs/hexo/issues/4917#issuecomment-1084567773. This exception will not occur after install js-yaml@4.1.0
manually. Because when you install a package manually npm use it preferentially.
$ npm install js-yaml@4.1.0
// for hexo 6.0.0
// $ npm install js-yaml@4.0.0
$ npm list js-yaml
hexo-generator-category@1.0.0 /mnt/c/Users/username/development/hexo/temp/hexo-generator-category
...
├─┬ hexo@6.1.0
│ ├─┬ hexo-front-matter@3.0.0
│ │ └── js-yaml@4.1.0 deduped
│ └── js-yaml@4.1.0 deduped
├── js-yaml@4.1.0 <- npm use this after install manually
...
$ npm run test
> hexo-generator-category@1.0.0 test
> mocha test/index.js
Category generator
✓ pagination enabled
✓ pagination disabled
✓ custom pagination_dir
3 passing (67ms)
It is already js-yaml 4.1.0 that is shipped with hexo 6.1.0
Yes, I know. Not sure, but I assume this error seems incorrect version resolving of
js-yaml
.How to reproduce?
// git clone & checkout $ git clone https://github.com/hexojs/hexo-generator-category.git $ git checkout -b issue-4917 f51949900e5dbd15902b45fe4399afb634d54b21 $ git log --oneline f519499 (HEAD -> issue-4917) chore(ci): migrate travisCI to GitHubActions (#70) f233a38 chore(deps): bump hexo-pagination from 1.0.0 to 2.0.0 (#46) fadee1a Upgrade to GitHub-native Dependabot (#45) // hexo@5.4.0 will be installed $ npm install // install hexo@6.1.0 $ npm install hexo@6.1.0 // run test $ npm run test > hexo-generator-category@1.0.0 test > mocha test/index.js YAMLException: Specified list of YAML types (or a single Type object) contains a non-Type object. at /mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/node_modules/js-yaml/lib/schema.js:104:13 at Array.forEach (<anonymous>) at Schema.extend (/mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/node_modules/js-yaml/lib/schema.js:102:12) at Object.<anonymous> (/mnt/c/Users/username/development/hexo/hexo-generator-category/node_modules/hexo/lib/plugins/renderer/yaml.js:5:36) at Module._compile (node:internal/modules/cjs/loader:1103:14)
Dependency tree
Here is the dependency tree after exec
How to reproduce?
section. Certainly,hexo@6.1.0
depends onjs-yaml@4.1.0
and it seems no problem.$ npm list js-yaml hexo-generator-category@1.0.0 /mnt/c/Users/username/hexo/hexo-generator-category ├─┬ coveralls@3.1.1 │ └── js-yaml@3.14.1 ├─┬ eslint@7.32.0 │ ├─┬ @eslint/eslintrc@0.4.3 │ │ └── js-yaml@3.14.1 deduped │ └── js-yaml@3.14.1 deduped ├─┬ hexo@6.1.0 │ ├─┬ hexo-front-matter@3.0.0 │ │ └── js-yaml@4.1.0 │ └── js-yaml@4.1.0 <- should be use this. but not actually used??? ├─┬ mocha@8.4.0 │ └── js-yaml@4.0.0 └─┬ nyc@15.1.0 └─┬ @istanbuljs/load-nyc-config@1.1.0 └── js-yaml@3.14.1 deduped
But, as you know exception occurs when run test. I wrote at the beginning of this comment, I'm not sure but it seems the
require('js-yaml')
resolves older than the4.0.0
version ofjs-yaml.
.I don't know which is the cause
hexo
,npm
, orjs-yaml
.Workaround
As I wrote in #4917 (comment). This exception will not occur after install
js-yaml@4.1.0
manually. Because when you install a package manually npm use it preferentially.$ npm install js-yaml@4.1.0 // for hexo 6.0.0 // $ npm install js-yaml@4.0.0 $ npm list js-yaml hexo-generator-category@1.0.0 /mnt/c/Users/username/development/hexo/temp/hexo-generator-category ... ├─┬ hexo@6.1.0 │ ├─┬ hexo-front-matter@3.0.0 │ │ └── js-yaml@4.1.0 deduped │ └── js-yaml@4.1.0 deduped ├── js-yaml@4.1.0 <- npm use this after install manually ... $ npm run test > hexo-generator-category@1.0.0 test > mocha test/index.js Category generator ✓ pagination enabled ✓ pagination disabled ✓ custom pagination_dir 3 passing (67ms)
latest of hexo-cli
automated change local hexo
package to version 6.0.0
so sad :(
now, my website https://webmanajemen.com got truncated for many posts (i didnt check one by one of 800+ pages)
I have the same situation after updating hexo to 6.1.0.
We released hexo 6.2.0 just now. It includes this issue workaround.
Thank you.
We released hexo 6.2.0 just now. It includes this issue workaround.
Thank you.
i have same problem on 6.2.0
We released hexo 6.2.0 just now. It includes this issue workaround.
Thank you.
PS D:\Users\20292\Documents\GitHub\hexo.bak> npm install hexo@latest -g
changed 93 packages in 4s
15 packages are looking for funding
run `npm fund` for details
PS D:\Users\20292\Documents\GitHub\hexo.bak> hexo --safe
WARN YAMLException: please see https://github.com/hexojs/hexo/issues/4917
FATAL TypeError: Cannot read property 'length' of undefined
at composeNode (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1492:60)
at readBlockMapping (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1104:12)
at composeNode (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1441:12)
at readDocument (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1625:3)
at loadDocuments (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1688:5)
at Object.load (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\node_modules\js-yaml\lib\loader.js:1714:19)
at Hexo.yamlHelper (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\lib\plugins\renderer\yaml.js:20:15)
at Hexo.tryCatcher (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\method.js:15:34)
at D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\hexo\lib\hexo\render.js:81:22
at tryCatcher (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\Users\20292\Documents\GitHub\hexo.bak\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (node:internal/timers:464:21)
I tried yarn add js-yaml@latest
, and it seems to solve the problem.
Having the same problem on 6.2.0
Having the same problem on 6.2.0
Have you tried this?
I tried
yarn add js-yaml@latest
, and it seems to solve the problem.
Having the same problem on 6.2.0
Have you tried this?
I tried
yarn add js-yaml@latest
, and it seems to solve the problem.
Installed yarn and seems yarn add js-yaml@latest
solves the problem :)
Why is version 6.2 still an error。but hexo g
andhexo s
http://localhost:4000/ is ok?
I tried
yarn add js-yaml@latest
, and it seems to solve the problem.
Theoretically npm install js-yaml@latest
may be ok as well.
Why is version 6.2 still an error。but
hexo g
andhexo s
http://localhost:4000/ is ok?
Try the method above plz. Though I can't explain why it works. Maybe it's because hexo 6.2.0 requires the latest version of js-yaml but the module isn't the latest one, which triggers the problem.
I tried
yarn add js-yaml@latest
, and it seems to solve the problem.Theoretically
npm install js-yaml@latest
may be ok as well.Why is version 6.2 still an error。but
hexo g
andhexo s
http://localhost:4000/ is ok?Try the method above plz. Though I can't explain why it works. Maybe it's because hexo 6.2.0 requires the latest version of js-yaml but the module isn't the latest one, which triggers the problem.
Thank you for your answer But it still gets seven critical bug warnings, Later it was found that there was a problem with uploading one more folder for online use。
Latest version of HEXO 6.2.0 still fails to start. This workaround resolved it:
npm install js-yaml@4.1.0
I don't use hexo but had the same issue on my project. Landed here while trying to see if anyone was having the same issue and that it wasn't just me doing something stupid.
Did some digging and the problem is with the js-yaml-js-type dependency. If they move js-yaml as a peer dependency there it will ensure that the same instance/version is used and this error will go away. I opened a pull request to address it, hopefully it gets merged soon.
nodeca/js-yaml-js-types#5
- install hexo 6.0.0
npm i hexo@6.0.0
- replace hexo version
6.1.0
to6.0.0
inpackage.json
{ "hexo": { "version": "6.0.0" } }
if still get errors. delete
package-lock.json
andnode_modules
then reinstall withnpm install hexo@6.0.0
fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/runs/5657131614?check_suite_focus=true
Thanks man, it works
Having the same problem on 6.3.0
I STILL have this problem after upgrading from 4.1.0 to 6.3.0, and npm install js-yaml@latest
solved it.
Added a PR to the docs' troubleshotting page regarding this issue.
Just my 50 cents...
All of these tips above only worked for me after deleting node_modules
, package-lock.json
, adding "js-yaml": "^4.1.0"
to package.json
and run npm install
.
Now I got what I want ... fresh Hexo installation
我在使用Hexo 7.0.0 (RC1),遇到了该错误,确认配置文件格式正确,但是仍然报错
@kristofzerbe
hexo 7.2.0 same error
hexo -v WARN YAMLException: please see https://github.com/hexojs/hexo/issues/4917 hexo: 7.2.0
I upgraded my hexo dependencies:
Check List
hexo version
to check)Expected behavior
Normal generation with
hexo g
.Actual behavior
It seems this line triggers it:
https://github.com/nodeca/js-yaml/blob/49baadd52af887d2991e2c39a6639baa56d6c71b/lib/schema.js#L104
How to reproduce?
I'm not able to create a minimal reproducible environment. It's especially hard since the error message doesn't tell me which file triggers the error. So I create a private repository with my code by I can only add user one by one as collaborator and not the whole
hexojs/core
team at once. So please ask me access and I'll add you.hexo g
Is the problem still there under "Safe mode"?
Yes it is a dependency of hexo core
Environment & Settings
Node.js & npm version(
node -v && npm -v
)Your site
_config.yml
(Optional)Your theme
_config.yml
Changing the theme to
landscape
still triggers the error so it's not from my theme.Hexo and Plugin version(
npm ls --depth 0
)Your package.json
package.json