electron-vue icon indicating copy to clipboard operation
electron-vue copied to clipboard

Problem when trying to use global Sass files.

Open ataschz opened this issue 8 years ago • 12 comments

Found an issue or bug with electron-vue? Tell me all about it!

Questions regarding how to use electron or vue are likely to be closed as they are not direct issues with this boilerplate. Please seek solutions from official documentation or their respective communities.

Describe the issue / bug.

# I am trying to use a global Sass file and access color variables from it in my components, but I always get the result of "variable not found".

How can I reproduce this problem?

# In a new project from scratch, configure a global Sass file following the official guide in this link.

If visual, provide a screenshot.

# image

Tell me about your development environment.
  • Node version: v8.11.3
  • NPM version: 5.6.0
  • Yarn version: 1.6.0
  • vue-cli version: 2.9.6
  • Operating System: Windows 10 BUILD 1803

If you are looking to suggest an enhancement or feature, then feel free to remove everything above.

ataschz avatar Sep 22 '18 02:09 ataschz

This is my current webpack configuration.

image

ataschz avatar Sep 22 '18 02:09 ataschz

Change this

_20181010133133

to

_20181010133405

This worked for me.

abramdev avatar Oct 10 '18 05:10 abramdev

Had a similar issue #752. It was solved using @Abramwow tip. thanks

JojoMig avatar Nov 15 '18 16:11 JojoMig

To whomsoever it may concern—

I had a similar problem, and spend about nine, NINE hours trying to debug this. Turns out, I just had to include the file extension in the webpack.renderer.config.js file.

loaders: {
    sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1&data=@import "./src/renderer/assets/css/main.scss"',
    scss: 'vue-style-loader!css-loader!sass-loader?data=@import "./src/renderer/assets/css/main.scss";'
}

I now wear a toupé.

sujan-s avatar Jan 06 '19 13:01 sujan-s

Ah ok, this problem is solved with answer of @Abramwow. Please, close this issue.

Thanks!

ataschz avatar Jan 21 '19 14:01 ataschz

This saved my day. Thanks.

asakiasako avatar Mar 11 '19 16:03 asakiasako

@abramdev 's answer worked for me.

This should probably be updated in https://simulatedgreg.gitbooks.io/electron-vue/content/en/using_pre-processors.html because the example given doesn't work.

mochi-co avatar Mar 12 '19 17:03 mochi-co

Wanted to follow up on this as I am also having issues following: https://simulatedgreg.gitbooks.io/electron-vue/content/en/using_pre-processors.html

I did also try using @abramdev 's approach and that worked, however I could never get it to allow me to use standard scss formatting. It kept wanting me to use indentedSyntax no matter how hard I tried to turn it off.

If anyone has any thoughts where I might be going wrong, please let me know. New to vue-electron.

cuzzins avatar Jul 12 '19 20:07 cuzzins

Wanted to follow up on this as I am also having issues following: https://simulatedgreg.gitbooks.io/electron-vue/content/en/using_pre-processors.html

I did also try using @abramdev 's approach and that worked, however I could never get it to allow me to use standard scss formatting. It kept wanting me to use indentedSyntax no matter how hard I tried to turn it off.

If anyone has any thoughts where I might be going wrong, please let me know. New to vue-electron.

Did you update the scss not the sass loader?

karlpablo avatar Jul 13 '19 00:07 karlpablo

Thank you @abramdev

DiegoFleitas avatar Feb 16 '20 19:02 DiegoFleitas

Change this

_20181010133133

to

_20181010133405

This worked for me.

data has been renamed to prependData in v8.

bbrandt avatar Apr 15 '20 20:04 bbrandt

I've just spent the better part of the day resolving this, and in my case the fault lied in missing the semicolon at the end of the import.

ngr900 avatar Jul 02 '20 22:07 ngr900