question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have added the scss loader:

    httpVueLoader.langProcessor.scss = function (scssText) {
        let css = ''
        sass.compile(scssText, function (result) {
            css = result.text
        })
        return css
    }

and in my template I have:

<style scoped lang='scss' src='page.scss'></style>

I know that the langProcessor works because if I add a console.log(css) I get valid css. Since I have working processors for pug and es6 via babel I don’t think my setup is broken.

If I just use plain css as in:

<style scoped>
  .main { color: red}
</style>

it also works.

I couldn’t import via @import inside my style tags because then the page.scss file was never found so I gave up on that. Still, I can’t see why this is not working.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FranckFreiburgercommented, Mar 21, 2018

Since sass.compile is asynchronous, you should return a promise:

    httpVueLoader.langProcessor.scss = function (scssText) {
        return new Promise(function(resolve, reject) {
            sass.compile(scssText, function (result) {
                if ( result.status === 0 )
                    resolve(result.text)
                else
                    reject(result)
            });
        });
    }

(untested)

0reactions
gaby64commented, Dec 17, 2019

where do you get that sass.compile function? still fighting with that

https://github.com/medialize/sass.js/

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode: SCSS not compiling to CSS
I'm working in VSCode using HTML, SCSS and Bootstrap. All installed via npm from the terminal. I was working on and suddenly came...
Read more >
ruby on rails - Scss not working - Stack Overflow
So I have my navbar scss working perfectly fine but for some reason I cant get any scss to work on my posts....
Read more >
Changes in files.scss not working - Sharetribe
Hello all, i'm making some changes on _home.scss and once i upload the file and restart nginx nothing changes... Do you have an...
Read more >
SCSS preset is not working with latest node-sass #195 - GitHub
If you have sass-loader installed try changing the installed version to 10.1.1, that fixed it for me. v11 went out on Feb 5th...
Read more >
How to style with SASS/SCSS in React ? - GeeksforGeeks
Filename- App.scss: ... Note: If there is a compiling issue downgrade node-sass as follows: npm install node-sass@4.14.1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found