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

not able to render scss file with hexo-3.2.2 #14

Open
ghost opened this issue Jul 9, 2016 · 16 comments
Open

not able to render scss file with hexo-3.2.2 #14

ghost opened this issue Jul 9, 2016 · 16 comments

Comments

@ghost
Copy link

ghost commented Jul 9, 2016

ERROR Asset render failed: app.css
TypeError: Cannot read property 'node_sass' of undefined
    at Hexo.sassRenderer (D:\code\bootstrapo.com\node_modules\.npminstall\hexo-renderer-sass\0.2.0\hexo-renderer-sass\index.js:8:22)
    at D:\code\bootstrapo.com\node_modules\.npminstall\hexo\3.2.2\hexo\lib\hexo\render.js:61:21
    at tryCatcher (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\promise.js:504:31)
    at Promise._settlePromise (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\promise.js:561:18)
    at Promise._settlePromise0 (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\promise.js:606:10)
    at Promise._settlePromises (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\promise.js:685:18)
    at Async._drainQueue (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\async.js:138:16)
    at Async._drainQueues (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\code\bootstrapo.com\node_modules\.npminstall\bluebird\3.4.1\bluebird\js\release\async.js:17:14)
    at tryOnImmediate (timers.js:543:15)
@JLHwung
Copy link
Collaborator

JLHwung commented Dec 18, 2016

Hi callmelanmao,
Have you specify a correct theme on root _config.yml?

@ghost
Copy link
Author

ghost commented Dec 19, 2016

sample _config.yml

node_sass:

just add node_sass in config.yml to make sure the variable exist, you could add properties to override https://github.com/sass/node-sass config

@JLHwung
Copy link
Collaborator

JLHwung commented Dec 20, 2016

Hi callmelanmao,

The error is TypeError: Cannot read property 'node_sass' of undefined, which means that hexo.theme.config is undefined.

Could you please run

hexo generate --debug | grep Theme

and post the terminal output?

Thank you.

@ghost
Copy link
Author

ghost commented Dec 20, 2016

you can add these code to your theme's config file, as i remember it's called _config.yml too

node_sass:
  outputStyle: nested
  precision: 5
  sourceComments: false

@JLHwung
Copy link
Collaborator

JLHwung commented Dec 20, 2016

Hi callmelanmao,

hexo-renderer-sass works well with my theme. I set empty node_sass config because I don't customize that.

I am wondering in what situation will TypeError: Cannot read property 'node_sass' of undefined be thrown. It might be some configuration error but I need more digging around that.

Thank you.

@JLHwung
Copy link
Collaborator

JLHwung commented Mar 5, 2017

Hi callmelanmao,

Could you test against 0.3.1 to see if this issue is reproducible? Thank you.

@FloatingGuy
Copy link

@JLHwung
i run command : hexo generate --debug | grep Theme

Output here:
/home/floatg/data/FG-Blog/myBlog/node_modules/hexo-renderer-sass/lib/renderer.js:7
module.exports = (ext) => function (data) {
^
04:05:05.148 ERROR Plugin load failed: hexo-renderer-sass
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/hexo/index.js:213:21)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo-renderer-sass/index.js:4:20
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:636:18)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/nodeback.js:42:21
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:78:16
at fs.js:268:14
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/nunjucks/node_modules/chokidar/node_modules/readdirp/node_modules/graceful-fs/graceful-fs.js:43:10
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:43:10
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/warehouse/node_modules/graceful-fs/graceful-fs.js:43:10
at /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:43:10
at Object.oncomplete (fs.js:107:15)
04:05:05.554 DEBUG Theme config loaded.

Thank you

@JLHwung
Copy link
Collaborator

JLHwung commented Mar 14, 2017

Hi Floating Guy.

I doubt the error is due to incompatible node.js versions. What's the output of the following command?

node --version

Thank you.

@FloatingGuy
Copy link

v0.10.25

@JLHwung
Copy link
Collaborator

JLHwung commented Mar 14, 2017

Hi Floating Guy,

Unfortunately hexo-renderer-sass has dropped supports on node.js v0.10 and v0.12 as many other node.js package did.

If you are using node.js v0.12 or older, please stick to v0.2.0, thank you.

@FloatingGuy
Copy link

Hi @JLHwung

Thanks, i have install node.js v6.9.4, still hava a bug.

myBlog git:(master) ✗ hexo generate --debug | grep Theme

/home/floatg/data/FG-Blog/myBlog/node_modules/hexo-renderer-sass/lib/renderer.js:7
module.exports = (ext) => function (data) {
^
05:41:23.926 ERROR Plugin load failed: hexo-renderer-sass
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/hexo/index.js:213:21)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo-renderer-sass/index.js:4:20
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:636:18)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/nodeback.js:42:21
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:78:16
at fs.js:268:14
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/nunjucks/node_modules/chokidar/node_modules/readdirp/node_modules/graceful-fs/graceful-fs.js:43:10
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:43:10
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/warehouse/node_modules/graceful-fs/graceful-fs.js:43:10
at /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:43:10
at Object.oncomplete (fs.js:107:15)
05:41:24.315 DEBUG Theme config loaded.
05:41:25.653 FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot set property 'lastIndex' of undefined
at highlight (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:514:35)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:564:21
at Array.forEach (native)
at Object.highlightAuto (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:563:40)
at highlight (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:100:19)
at highlightUtil (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:22:14)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:49:15
at String.replace (native)
at Hexo.backtickCodeBlock (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31)
at Hexo.tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Hexo. (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/extend/filter.js:68:35
at tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromiseCtx (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10)
at Async._drainQueue (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:17:14)
at process._tickCallback (node.js:415:13)
05:41:25.810 FATAL Cannot set property 'lastIndex' of undefined
TypeError: Cannot set property 'lastIndex' of undefined
at highlight (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:514:35)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:564:21
at Array.forEach (native)
at Object.highlightAuto (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/node_modules/highlight.js/lib/highlight.js:563:40)
at highlight (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:100:19)
at highlightUtil (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/hexo-util/lib/highlight.js:22:14)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:49:15
at String.replace (native)
at Hexo.backtickCodeBlock (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31)
at Hexo.tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Hexo. (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34)
at /home/floatg/data/FG-Blog/myBlog/node_modules/hexo/lib/extend/filter.js:68:35
at tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:155:18)
at Object.gotAccum (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/reduce.js:144:25)
at Object.tryCatcher (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromiseCtx (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:604:10)
at Async._drainQueue (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/home/floatg/data/FG-Blog/myBlog/node_modules/hexo/node_modules/bluebird/js/release/async.js:17:14)
at process._tickCallback (node.js:415:13)

@JLHwung
Copy link
Collaborator

JLHwung commented Mar 14, 2017

Hi Floating Guy,

Could you print the output of the following command?

hexo version

Thank you.

@FloatingGuy
Copy link

hexo: 3.2.2
hexo-cli: 1.0.2
os: Linux 4.2.0-27-generic linux x64
http_parser: 2.7.0
node: 6.9.4
v8: 5.1.281.89
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2j

@JLHwung
Copy link
Collaborator

JLHwung commented Mar 14, 2017

Hi Floating Guy,
I tested on node.js v6 environment and can not reproduce the issue. Could you restart your shell environment to see if this issue can be reproduced?

@kmuncie
Copy link

kmuncie commented Dec 1, 2017

I could only get hexo-renderer-sass to function with Node 6.x

Based on the release schedule it would be nice if this package could be updated to support Node 8.x

@M165437
Copy link

M165437 commented Mar 20, 2018

Had the same problem, switched to https://github.com/mamboer/hexo-renderer-scss and it works fine with Node 8.x

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

5 participants