Electron-vue: Problem when trying to use global Sass files.

Created on 22 Sep 2018  ·  12Comments  ·  Source: SimulatedGREG/electron-vue

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.

question

Most helpful comment

Change this

_20181010133133

to

_20181010133405

This worked for me.

All 12 comments

This is my current webpack configuration.

image

Change this

_20181010133133

to

_20181010133405

This worked for me.

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

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é.

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

Thanks!

This saved my day. Thanks.

@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.

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.

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?

Thank you @abramdev

Change this

_20181010133133

to

_20181010133405

This worked for me.

data has been renamed to prependData in v8.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webrtcn picture webrtcn  ·  3Comments

simdax picture simdax  ·  3Comments

rodrigomata picture rodrigomata  ·  3Comments

haomehaode picture haomehaode  ·  3Comments

jt-wang picture jt-wang  ·  3Comments