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

Cannot resolve to SCSS partial files #39

Closed
hinok opened this issue Mar 10, 2017 · 7 comments
Closed

Cannot resolve to SCSS partial files #39

hinok opened this issue Mar 10, 2017 · 7 comments

Comments

@hinok
Copy link

hinok commented Mar 10, 2017

Hey,
I've found that when trying to import scss partial file, plugin doesn't work correctly because it doesn't resolve to scss partial file with leading underscore e.g. _partial.scss.

In dev tools

{
  "errno":-2,
  "code":"ENOENT",
  "syscall":"stat",
  "path":"/Users/Batman/Desktop/Wayne/src/index.scss" 
  // index.scss doesn't exist but this exists _index.scss
}

When trying to resolve path for @import '...', I think that plugin should also check if partial file exists, like

/Users/Batman/Desktop/Wayne/src/_index.scss
@mrmlnc mrmlnc self-assigned this Mar 10, 2017
@mrmlnc mrmlnc added this to the 1.0.0 milestone Mar 10, 2017
@Arikael
Copy link

Arikael commented Mar 28, 2017

I just wanted to add that if you don't import your partial files including underscore and extension, the whole plugins crashes and stops working even in unrelated files.

so if you, like me always import partials without extension or underscore and the extension is not working this may be the cause.

Also: I had to include //

@Christo44
Copy link

Christo44 commented May 30, 2017

Ah this might be what I'm experiencing too. #42
I disabled @import font-face and it started working again, to some extend, but of course not the solution.

@Arikael can you give me an example of how you structure your paths ? I've tried other ways but appears the plugin will not read underscore partials.
keeps looking for assets/scss/vendor/bourbon/bourbon.scss but should be looking for assets/scss/vendor/bourbon/_bourbon.scss

@mrmlnc
Copy link
Owner

mrmlnc commented May 31, 2017

Will be cool, if you give me more examples of your problem. Now my fast & lightweight parser has no support for @include font-face("Akkurat-Bold", "../fonts/akkurat/lineto-akkurat-bold");. I try to find time for this issue and #42.

@Arikael
Copy link

Arikael commented May 31, 2017

@Christo44
Sorry, we recently switched from VS Code to WebStorm and I haven't used VS Code since then.
If I remember correctly I had to explicitly import any partials including underscore and extensions

@import '_bourbon.scss;'

instead of
@import 'bourbon'

@Christo44
Copy link

@Arikael
using @import 'bourbon' gives no errors in vscode, but using @import '_bourbon.scss' does.

[Error - 10:03:18 AM] (node:27190) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, stat '/Users/.../Sites/.../source/assets/scss/vendor/_normalize.scss'

@phifa
Copy link

phifa commented May 31, 2017

I think I am experiencing the same isse, not sure. I am using the Foundation Zurb Framework. This is how you can reproduce:

npm install --global foundation-cli
foundation new please choose the zurb template.

that's it, now you can watch the files with foundation watch.

Mixin and variable completion does not work, I suppose it is because of underscores/partials, etc.

@mrmlnc
Copy link
Owner

mrmlnc commented Jun 14, 2017

Closed in favor of #49

@mrmlnc mrmlnc closed this as completed Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants