-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAMLException: Specified list of YAML types (or a single Type object) contains a non-Type object. #4917
Comments
i have same problem too |
@dimaslanjaka Have you a public repository with the error happening? |
i have same problem too. |
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 |
I have this problem too |
No @lzkids
@MCSeekeri thanks for sharing the URL |
My fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/actions |
npm i hexo@6.0.0
{
"hexo": {
"version": "6.0.0"
}
} if still get errors. fixed workflow https://github.com/dimaslanjaka/dimaslanjaka.github.io/runs/5657131614?check_suite_focus=true |
Nice to know, thk for the workaround. It confirms 6.1.0 has introduced a bug and need to be fixed. |
Relevant pull request: #4869 |
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 |
It is already js-yaml 4.1.0 that is shipped with hexo 6.1.0 Line 51 in 8d21027
It's already what is in my "hexo": {
- "version": "6.0.0"
+ "version": "6.1.0"
},
"dependencies": {
"hexo": "^6.1.0", |
Yes, I know. 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 treeHere is the dependency tree after exec $ 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 I don't know which is the cause WorkaroundAs I wrote in #4917 (comment). This exception will not occur after install $ 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 just a workaround
* it is just a workaround
latest of |
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. |
i have same problem on 6.2.0 |
|
I tried |
Having the same problem on 6.2.0 |
Have you tried this?
|
Installed yarn and seems |
Why is version 6.2 still an error。but |
Theoretically
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 |
Latest version of HEXO 6.2.0 still fails to start. 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. |
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 |
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 Now I got what I want ... fresh Hexo installation |
我在使用Hexo 7.0.0 (RC1),遇到了该错误,确认配置文件格式正确,但是仍然报错 |
hexo 7.2.0 same error hexo -v |
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
The text was updated successfully, but these errors were encountered: