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

DeprecationWarning: Module Chunks #28

Closed
dgonzalezr opened this issue Feb 21, 2018 · 2 comments
Closed

DeprecationWarning: Module Chunks #28

dgonzalezr opened this issue Feb 21, 2018 · 2 comments

Comments

@dgonzalezr
Copy link

dgonzalezr commented Feb 21, 2018

I'm getting the following warning/error when parsing a bootstrap _variable.scss file. I'm currently working with next.js

 ERROR  Failed to compile with 5 errors

This dependency was not found:

* fs in ./node_modules/mkdirp/index.js, ./node_modules/node-sass/lib/extensions.js and 3 others

To install it, you can run: npm install --save fs
(node:9903) DeprecationWarning: Module.chunks: Use Module.forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk instead

Here's my peace of code:

import { ThemeProvider } from 'styled-components';
import { renderSync } from 'sass-extract';

const theme = renderSync(
    {
        file: 'scss/themes/bootstrap/_variables.scss'
    },
    {
        plugins: ['sass-extract-js']
    }).vars;

Packages version:

"sass-extract": "^2.1.0",
"sass-extract-js": "^0.3.0",
"node-sass": "^4.7.2",

Even though the variables are parsed and I can access them in a plan JSON object, but it's a bit weird 😟

@JoaoTMDias
Copy link

Same thing happens with me!
I'm using gatsbyjs!

@jgranstrom
Copy link
Owner

The sass-extract library has to run in a server environment such as node.js and cannot be imported in the frontend application directly. When using webpack you have to install both sass-extract and sass-extract-loader and import as mentioned in the readme. sass-extract will be run by webpack during compilation on the server, and the extracted output will be exposed as an object to your application. This is the same way sass compilation works when using for example the sass-loader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants