You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hexo.theme.config should be of type any or another type that allows access to unknown properties. For example, the following line of code works well on Hexo 7.0.0:
But in Hexo 7.1.0, this code cannot pass TypeScript compilation because hexo.theme.config is of type object, and this type does not allow access to unknown properties. When compiling the above code with Hexo 7.1.0, the result is:
Error: utils.ts(24,40): error TS2339: Property 'vendors' does not exist on type 'object'.
If I want to make it compile in Hexo 7.1.0, I have to use the following code snippet:
Check List
hexo version
to check)Expected behavior
The
hexo.theme.config
should be of typeany
or another type that allows access to unknown properties. For example, the following line of code works well on Hexo 7.0.0:Actual behavior
But in Hexo 7.1.0, this code cannot pass TypeScript compilation because
hexo.theme.config
is of typeobject
, and this type does not allow access to unknown properties. When compiling the above code with Hexo 7.1.0, the result is:If I want to make it compile in Hexo 7.1.0, I have to use the following code snippet:
How to reproduce?
Accessing any custom property of
hexo.theme.config
in TypeScript.Is the problem still there under
Safe mode
?This issue occurs in the development environment and is unrelated to Safe Mode.
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)No response
Others
No response
The text was updated successfully, but these errors were encountered: