Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

hexo-renderer-sass using error #101

Closed
hiddenchristmas opened this issue Jan 25, 2018 · 5 comments · Fixed by #103
Closed

hexo-renderer-sass using error #101

hiddenchristmas opened this issue Jan 25, 2018 · 5 comments · Fixed by #103
Assignees
Labels
Milestone

Comments

@hiddenchristmas
Copy link

hiddenchristmas commented Jan 25, 2018

https://zalando-incubator.github.io/hexo-theme-doc/usage-and-configuration/sass-styles.html
like the link, I created source/styles/doc.scss in the project root directory
and wrote down only this codes;
$doc-color-primary: red; // set primary color to "red"
@import "../node_modules/hexo-theme-doc/_doc.scss"
and it causes the error when I "hexo g"
it says
"Error: File to import not found or unreadable: ../node_modules/hexo-theme-doc/_doc.scss.
Parent style sheet: /Users/boyeon/study/blog/dokinchan/source/styles/doc.scss"

What should I do??

Specifications

  • NodeJS Version: 8.9.4
  • NPM Version: 5.6.0
  • OS: mac
  • Hexo Version: 3.4.4
@rbarilani
Copy link
Contributor

Hi @dokinchan, there is a typo in the documentation page

with:

@import "../../node_modules/hexo-theme-doc/_doc.scss"
/* NOT: @import "../node_modules/hexo-theme-doc/_doc.scss" */

It should work.

@rbarilani rbarilani added the bug label Jan 25, 2018
@rbarilani rbarilani self-assigned this Jan 25, 2018
@rbarilani
Copy link
Contributor

@dokinchan We are having issues with SCSS imports and npm. Working on a proper fix.

rbarilani added a commit that referenced this issue Jan 25, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 25, 2018
* no relative imports anymore
* user should update the configuration

related to #101
rbarilani added a commit that referenced this issue Jan 25, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0
* chore(npm): add package-lock.json under version control

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
rbarilani added a commit that referenced this issue Jan 26, 2018
* fix(sass): user customization and relative imports errors #101
* chore(sass): use `include-path` option to include `node_modules` folder and let us import third-party scss files without ugly relative imports
* chore(npm): adjust `dress-code` semver to only minor
* chore(dress-code): update fonts to ~2.4.0

close #101

BREAKING CHANGE:

Users utilizing hexo-theme-doc and sass are asked to update their configuration
file(s) and add:

```yaml
node_sass:
  includePaths:
		- node_modules
```
@walkccc
Copy link

walkccc commented Jan 28, 2018

Hi @rbarilani, after changing the file in "/{rootFolder}/source/styles/doc.scss"(This was added manually mentioned by @dokinchan earlier.)

from /* NOT: @import "../node_modules/hexo-theme-doc/_doc.scss" */
to @import "../../node_modules/hexo-theme-doc/_doc.scss"

It still not work for me.

The error messages:

~/CLRS/source(CLRS-sources*) » hexo s jay@Jays-MacBook-Pro
INFO Start processing
Error: File to import not found or unreadable: ../../../node_modules/dress-code/dist/sass/dress-code.
Parent style sheet: /Users/Jay/CLRS/node_modules/hexo-theme-doc/source/style/_doc/index.scss
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: File to import not found or unreadable: ../../../node_modules/dress-code/dist/sass/dress-code.
Parent style sheet: /Users/Jay/CLRS/node_modules/hexo-theme-doc/source/style/_doc/index.scss
at Object.module.exports.renderSync (/Users/Jay/CLRS/node_modules/node-sass/lib/index.js:439:16)
at Hexo. (/Users/Jay/CLRS/node_modules/hexo-renderer-sass/lib/renderer.js:25:23)
at /Users/Jay/CLRS/node_modules/hexo/lib/hexo/render.js:61:21
at tryCatcher (/Users/Jay/CLRS/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/Jay/CLRS/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/Jay/CLRS/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/Users/Jay/CLRS/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/Users/Jay/CLRS/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/Users/Jay/CLRS/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Users/Jay/CLRS/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)

How can I do? Thanks!

Specifications

  • NodeJS Version: 8.9.4
  • NPM Version: 5.6.0
  • OS: macOS High Sierra version 10.13.3
  • Hexo Version: 3.5.0

@rbarilani
Copy link
Contributor

@dokinchan @walkccc working on a change that should fix the problem in the next release here. The change when merged will IMHO improve sass mechanism avoiding relative imports and fix the reported problem.

@rbarilani rbarilani added this to the 1.2.0 milestone Feb 15, 2018
rbarilani added a commit that referenced this issue Mar 18, 2018
* no relative imports anymore
* user should update the configuration

related to #101
rbarilani added a commit that referenced this issue Mar 19, 2018
* no relative imports anymore
* user should update the configuration

related to #101
@rkuzsma
Copy link

rkuzsma commented May 19, 2018

I confirmed @rbarilani 's change fixes the issue. To apply his change to your project, run npm i hexo-theme-doc@1.0.0-rc --save

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

Successfully merging a pull request may close this issue.

4 participants