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

SASS import file not found when using nested relative imports #404

Closed
steve-ross opened this issue Aug 3, 2018 · 4 comments
Closed

SASS import file not found when using nested relative imports #404

steve-ross opened this issue Aug 3, 2018 · 4 comments

Comments

@steve-ross
Copy link

Expected behavior

The file is imported as it does actually exist 🙂

Actual behavior

Random failures (hitting refresh a few times will fix it at random)

{ Error: ./header.scss doesn't exist!
    at options.error (/Users/homedir/.nvm/versions/node/v8.11.1/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@bigcommerce/node-sass/lib/index.js:277:32)
  formatted: 'Error: ./header.scss doesn\'t exist!\n        on line 2 of stdin\n>> @import \'./header\';\n   --------^\n',
  message: './header.scss doesn\'t exist!',
  column: 9,
  line: 2,
  file: 'stdin',
  status: 1 }

Steps to reproduce behavior

I haven't tried this on cornerstone or a new theme but, in ours we have some nested imports where the main theme file will import header and header.scss imports all of the files in the ./header:
image

sample base theme file that is doing the nested imports:

@import './variables';
@import './header';

The strangest part is this just randomly works or fails. Tried moving up and down on node versions and tried moving all the imports to the main theme file and the issue comes back.

I did dig up this issue: sass/libsass#1750 so it did make me wonder if the version of hode-sass needed to be updated in stencil-cli.

@canterberrygifts
Copy link

This seems be an issue in the windows environment #387

{ Error: bootstrap\variables.scss doesn't exist!
at options.error (C:\Users\matth\AppData\Roaming\npm\node_modules@bigcommerce\stencil-cli\node_modules@bigcommerce\node-sass\lib\index.js:277:32)

I would love a solution. The work around he used didn't work for me.

My environment
OS: Windows 10
git 2.19.1
Python 2.7
Node 8.12.0
MS Visual Studio 2017
Theme: Blackdeers V 1.0.1

@mikemfleming
Copy link

I'm getting the same error as this issue and sass/libsass#1750 only I am in a Mac environment.

@steve-ross
Copy link
Author

FWIW an odd fix on our theme (a modification of peak) was to import the main 'theme.scss' in our override file first and then proceed with our own imports. Haven't seen the error come back.

@2ps
Copy link
Contributor

2ps commented Feb 4, 2019

This is a bug in stencil-cli that occurs whenever you have multiple css files imported into an html file. We can issue a pull request with the fix. We can reliably get this to occur on centos, ubuntu, mac, and windows.

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