Skip to content
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

ERROR Asset render failed: css/style.css #245

Open
CrazyKidCN opened this issue Nov 28, 2018 · 10 comments
Open

ERROR Asset render failed: css/style.css #245

CrazyKidCN opened this issue Nov 28, 2018 · 10 comments

Comments

@CrazyKidCN
Copy link

报错如下

ERROR Asset render failed: css/style.css
CssSyntaxError: /var/www/hexo/themes/yelee2/source/css/style.styl:1076:3: Unknown word
at Input.error (/var/www/hexo/node_modules/postcss/lib/input.js:61:21)
at Parser.unknownDecl (/var/www/hexo/node_modules/postcss/lib/parser.js:470:26)
at Parser.decl (/var/www/hexo/node_modules/postcss/lib/parser.js:227:22)
at Parser.word (/var/www/hexo/node_modules/postcss/lib/parser.js:135:30)
at Parser.loop (/var/www/hexo/node_modules/postcss/lib/parser.js:60:26)
at parse (/var/www/hexo/node_modules/postcss/lib/parse.js:25:12)
at new LazyResult (/var/www/hexo/node_modules/postcss/lib/lazy-result.js:57:24)
at Processor.process (/var/www/hexo/node_modules/postcss/lib/processor.js:36:16)
at Hexo.module.exports (/var/www/hexo/node_modules/hexo-autoprefixer/lib/filter.js:19:49)
at Hexo.tryCatcher (/var/www/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Hexo. (/var/www/hexo/node_modules/bluebird/js/release/method.js:15:34)
at Promise.each.filter (/var/www/hexo/node_modules/hexo/lib/extend/filter.js:63:65)
at tryCatcher (/var/www/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/var/www/hexo/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/var/www/hexo/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/var/www/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/var/www/hexo/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/var/www/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/var/www/hexo/node_modules/bluebird/js/release/promise.js:606:10)
at _drainQueueStep (/var/www/hexo/node_modules/bluebird/js/release/async.js:142:12)
at _drainQueue (/var/www/hexo/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/var/www/hexo/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/var/www/hexo/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate (timers.js:632:19)

hexo --version

hexo: 3.8.0
hexo-cli: 1.1.0
os: Linux 4.18.18-1.el6.elrepo.x86_64 linux x64
http_parser: 2.8.0
node: 11.2.0
v8: 7.0.276.38-node.11
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 67
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0i
icu: 63.1
unicode: 11.0
cldr: 34.0
tz: 2018e

google遍了没找到解决方法.. 试过重装几个renderer没有用,更新hexo也没用..求支招...

@lettgers
Copy link

lettgers commented Feb 7, 2022

还有人遇到吗?求支招...

@ylongwang2782
Copy link

啊啊,我研究这个问题一个通宵了!有谁能帮帮我吗!要哭了

@hjl68
Copy link

hjl68 commented May 16, 2022

兄弟,解决了吗

@hjl68
Copy link

hjl68 commented May 16, 2022

我也遇到了

@bladedevoff
Copy link

我也是啊,我还报错//color什么的

@bladedevoff
Copy link

已经解决了,我用的是butterfly主题,可能和你们的不一样
解决过程:有可能是因为你自定义了主题色,改回去试试

@ZY19990807
Copy link

主题换回去,然后再改动你需要改动的,亲测有效

@ShiroiTree
Copy link

检查路径名称里是否存在# @ 等非法字符,可能导致运行错误的字符。

@stellaSalad
Copy link

我也遇到了,问了一下chat GPT,解决了,主要是要创建那个missing file.

Creating a Stylus stylesheet is quite straightforward. In your case, it seems that Hexo is expecting a file named styles.styl in the _data directory. Here are the steps to create an empty styles.styl file:

  • Navigate to the Directory:

Open your terminal or command prompt, and navigate to the _data directory in your Hexo project. Based on the error message, the path is: C:\Users\stell\Desktop\Website\Blog\source\_data in my case.

  • Create the File:
    Once you are in the correct directory, you can create the styles.styl file. You can do this using a text editor or the echo command on the command line. Here's an example using the command line:
echo "// Empty Stylus file" > styles.styl

This command creates a new file named styles.styl and adds a comment line to it.

  • Verify File Creation:

After running the command, you can check that the file has been created by using a text editor or by listing the files in the directory:

dir  # on Windows

or

ls   # on Linux/Mac

Look for styles.styl in the list of files.

  • Run Hexo:
    Once the file is created, try running hexo g again:
hexo g

Hexo should now be able to find the styles.styl file, and the error should be resolved.

Remember that this is just a placeholder file, and you may need to add actual Stylus code to it based on your theme's requirements. If the theme expects specific styling in styles.styl, you'll want to customize it accordingly. If you have any further questions or run into issues, feel free to ask!

@ShiroiTree
Copy link

ShiroiTree commented Jan 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants