hexo: Asset render failed: %s css/style.css

bug logs

`ERROR { err: OperationalError: D:\code\hexo\test\node_modules\hexo-theme-landscape\source\css\style.styl:90:29 86| @import “_partial/highlight” 87| @import “_partial/mobile” 88| 89| if sidebar 90| @import “_partial/sidebar” -----------------------------------^

failed to locate @import file D:\code\hexo\test\node_modules\stylus\lib\functions\index.styl

  at Evaluator.visitImport (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:915:21)
  at Evaluator.Visitor.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\index.js:28:40)
  at Evaluator.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:160:18)
  at Evaluator.visitRoot (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:707:27)
  at Evaluator.Visitor.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\index.js:28:40)
  at Evaluator.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:160:18)
  at Evaluator.evaluate (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:247:15)
  at Renderer.render (D:\code\hexo\test\node_modules\stylus\lib\renderer.js:86:26)
  at Hexo.stylusFn (D:\code\hexo\test\node_modules\hexo-renderer-stylus\lib\renderer.js:59:6)
  at Hexo.tryCatcher (D:\code\hexo\test\node_modules\bluebird\js\release\util.js:16:23)
  at Hexo.ret (eval at makeNodePromisifiedEval (D:\installation\nodejs\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39)
  at D:\code\hexo\test\node_modules\hexo\lib\hexo\render.js:81:22
  at tryCatcher (D:\code\hexo\test\node_modules\bluebird\js\release\util.js:16:23)
  at Promise._settlePromiseFromHandler (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:547:31)
  at Promise._settlePromise (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:604:18)
  at Promise._settlePromise0 (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:649:10)
  at Promise._settlePromises (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:729:18)
  at _drainQueueStep (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:93:12)
  at _drainQueue (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:86:9)
  at Async._drainQueues (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:102:5)
  at Immediate.Async.drainQueues [as _onImmediate] (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:15:14)
  at processImmediate (internal/timers.js:464:21) {
cause: Error: D:\code\hexo\test\node_modules\hexo-theme-landscape\source\css\style.styl:90:29
   86| @import "_partial/highlight"
   87| @import "_partial/mobile"
   88|
   89| if sidebar
   90|   @import "_partial/sidebar"
-----------------------------------^

failed to locate @import file D:\code\hexo\test\node_modules\stylus\lib\functions\index.styl

    at Evaluator.visitImport (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:915:21)        at Evaluator.Visitor.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:160:18)
    at Evaluator.visitRoot (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:707:27)
    at Evaluator.Visitor.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\index.js:28:40)
    at Evaluator.visit (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:160:18)
    at Evaluator.evaluate (D:\code\hexo\test\node_modules\stylus\lib\visitor\evaluator.js:247:15)
    at Renderer.render (D:\code\hexo\test\node_modules\stylus\lib\renderer.js:86:26)
    at Hexo.stylusFn (D:\code\hexo\test\node_modules\hexo-renderer-stylus\lib\renderer.js:59:6)
    at Hexo.tryCatcher (D:\code\hexo\test\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.ret (eval at makeNodePromisifiedEval (D:\installation\nodejs\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39)
    at D:\code\hexo\test\node_modules\hexo\lib\hexo\render.js:81:22
    at tryCatcher (D:\code\hexo\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:604:18)        at Promise._settlePromise0 (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (D:\code\hexo\test\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\code\hexo\test\node_modules\bluebird\js\release\async.js:15:14) '\n' +
  '@import "_extend"\n' +
  '@import "_partial/header"\n' +
  '@import "_partial/article"\n' +
  '@import "_partial/comment"\n' +
  '@import "_partial/archive"\n' +
  '@import "_partial/footer"\n' +
  '@import "_partial/highlight"\n' +
  '@import "_partial/mobile"\n' +
  '\n' +
  'if sidebar\n' +
  '  @import "_partial/sidebar"' }}
  Asset render failed: %s css/style.css`

Environment & Settings

Node.js & npm version(node -v && npm -v)

λ node -v
v14.17.1
λ npm -v
6.14.13

Your package.json package.json

 "hexo": {
    "version": "6.2.0"
  },
  "dependencies": {
    "hexo": "^6.2.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^5.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }

Others

how to solve it? I can get the HTML text but CSS is lost when the hexo server runs

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 30

Most upvoted comments

npm i glob@7.2.0 ** 我用这个方式解决了。 **

node16 npm8 修改 package.json https://github.com/volantis-x/demo/blob/5063cebe42975af229aea88fbcc0e25fa1cc3048/package.json#L14-L19 (顺便解释一下 glob 是用来处理本issues异常; nib 用来处理一个 Warning https://github.com/volantis-x/hexo-theme-volantis/discussions/738) 删除 package-lock.json node_modules 然后 执行安装命令

npm i

(安装glob只是执行了npm i,并没有什么用,如果安装了建议马上卸载 npm un glob)

https://github.com/hexojs/hexo/issues/4968

https://github.com/isaacs/node-glob/issues/471

have you solved that bug by degrading the hexo’s version? Can you tell me your right version of hexo and Node? I have tried lots of versions which seems useless! @lxx249

https://github.com/hexojs/hexo/issues/4968#issuecomment-1126828530

我也是遇到了同样的问题 image

@LGY07 不要发异常了,邮箱快满了 🤣

see heer: https://github.com/isaacs/node-glob/issues/471#issuecomment-1126739067

#4968 it can be solved by node-glob😋 or using linux

Thanks a lot, I have solved it by installing glob@7.2.0

have you solved that bug by degrading the hexo’s version? Can you tell me your right version of hexo and Node? I have tried lots of versions which seems useless!

lxx


From: MeowKing @.> Sent: Saturday, May 14, 2022 8:13:48 PM To: hexojs/hexo @.> Cc: lxx249 @.>; Author @.> Subject: Re: [hexojs/hexo] Asset render failed: %s css/style.css (Issue #4970)

it seems like a bug i tried to degrade my hexo and it worked fine now.

— Reply to this email directly, view it on GitHubhttps://github.com/hexojs/hexo/issues/4970#issuecomment-1126704393, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXAAJRHQF4UGPHZQA4LIJWTVJ6KHZANCNFSM5V5F2IWQ. You are receiving this because you authored the thread.Message ID: @.***>

I also had the same problem

$ node -v
v12.14.0

$ npm -v
6.13.4

$ hexo -v
hexo-cli: 4.3.0
os: win32 10.0.18363
node: 12.14.0
v8: 7.7.299.13-node.16
uv: 1.33.1
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 72
nghttp2: 1.39.2
napi: 5
llhttp: 1.1.4
http_parser: 2.8.0
openssl: 1.1.1d
cldr: 35.1
icu: 64.2
tz: 2019c
unicode: 12.1