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.

Asking to Install sass instead of node-sass

See original GitHub issue

Locally and in documentation it says to yarn add sass, but it should be yarn add node-sass

https://github.com/zeit/next.js/blob/master/errors/install-sass.md

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
jrock17commented, Sep 23, 2020

I’m having the same issue if I remove node-sass. I’m using Bulma.io FE framework and I think it requires node-sass.

4reactions
Xunnamiuscommented, May 13, 2020

I can report the exact same behavior. You can check out the repo here. Was pulling my hair out for a while until I stumbled upon this post. Installing node-sass instead of sass made everything work. For the record, my next.config.js file contains the following:

/* @flow */

import withTMInitializer from 'next-transpile-modules'
import withBundleAnalyzer from '@next/bundle-analyzer'
import DotenvWebpackPlugin from 'dotenv-webpack'
import { populateEnv } from './src/dev-utils'

populateEnv();

const paths = {
    universe: `${__dirname}/src/`,
    multiverse: `${__dirname}/lib/`,
    components: `${__dirname}/src/components/`,
    rbc: `${__dirname}/node_modules/react-bulma-components/src/components`
};

// ? Make Bulma work (it needs to be transpiled)
const withTM = withTMInitializer(['react-bulma-components']);

module.exports = () => {
    return withBundleAnalyzer({
        enabled: process.env.ANALYZE === 'true'
    })(withTM({
        sassOptions: {
            includePaths: [ require('path').join(__dirname, '/src') ]
        },

        // ? Webpack configuration
        // ! Note that the webpack configuration is executed twice: once
        // ! server-side and once client-side!
        webpack: (config: Object, { isServer }: Object) => {
            // ? These are aliases that can be used during JS import calls
            // ! Note that you must also change these same aliases in .flowconfig
            // ! Note that you must also change these same aliases in package.json (jest)
            config.resolve.alias = Object.assign({}, config.resolve.alias, {
                universe: paths.universe,
                multiverse: paths.multiverse,
                components: paths.components,
                rbc: paths.rbc,
            });

            if(isServer) {
                // ? Add referenced environment variables defined in .env to bundle
                config.plugins.push(new DotenvWebpackPlugin());
            }

            else {
                // ? Stops Next from throwing a tantrum over server-side
                // ? modules depending on node's `fs` builtin
                config.node = {
                  fs: 'empty'
                }
            }

            return config;
        }
    }));
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Asking to Install sass instead of node-sass #12263 - GitHub
We're intentionally suggesting sass and not node-sass , as it has more features, is faster to install, and typically faster to compile. 1...
Read more >
sass-loader require("node-sass")); but I installed sass
You can set the implementation of sass-loader in your package.json so it will use value of options.implementation instead of require("node-sass") :
Read more >
node-sass: Binding for Node.js to LibSass - KnowledgeHut
Node sass is a library that allows binding for Node.js to LibSass, the C version of Sass's stylesheet preprocessor. It compiles .scss files ......
Read more >
sass loader node sass compatible version - You.com - You.com
I encounter this problem today, and find the the link is very helpful. ... You need to run npm rebuild (or npm rb...
Read more >
node-sass | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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