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.

Update from version 3.2.0 to latest 4.1.0 breaks build. Undefined scss variables

See original GitHub issue

Hello @pmowrer ,

for my current project we updated the node-sass-json-importer from version 3.2.0 to version 4.1.0 but that causes the build to break with error message of undefined variables. The variables it complains about are normal scss variables within scss files which are not part of any json file (see screenshot). Any idea? 50899264-de6a0380-1411-11e9-8b6d-7844a370d46e

The project setup is build with grunt. Using node-sass und grunt-sass. The relevant part in grunt config is the following:

const jsonImporter = require('node-sass-json-importer');

module.exports = {
    css : {
        options: {
            importer: jsonImporter,
            style: 'nested',
            precision: 8,
            trace: true,
            lineNumbers: true,
            sourceMap: true,
            sourceComments: true
        },
        files : [{
            expand: true,
            cwd: '<%= package.sourceFolder %>/scss/',
            src: ['**/*.scss'],
            dest: '<%= package.buildFolder %>/css/',
            ext: '.css'
        }]
    }
}

It would be unfortunate circumstances if we would be forced to stick with an old version of node-sass-json-importer unable to update.

Best regards, Annick

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
pmowrercommented, Feb 4, 2020

Closed by #83

2reactions
Tyleriancommented, Aug 26, 2019

IMHO this is an issue with #74 and that commit should be reverted in order to fix it.

The reasoning behind this is that sass either expects an object literal with a contentskey in order to load that contents, or an object literal with a filekey to load that file as though it had been imported directly (as seen in docs). But not an object literal containing both file and contents.

@pmowrer would you accept a pull request reverting that behavior?

Read more comments on GitHub >

github_iconTop Results From Across the Web

rake aborted! Sass::SyntaxError: Undefined variable: "$alert ...
I moved _variables. scss from bootstrap gem folder to stylesheets and renamed this file as variables and imported it to application. scss But...
Read more >
sass-loader | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Release notes | U.S. Web Design System (USWDS) - Digital.gov
Here you'll find our release notes — summaries of bug fixes, new features, and other updates introduced in each release. Have suggestions for...
Read more >
Changelog - Sphinx documentation
Please notice it changes the output of HTML builder. Some themes do not support it, and you need to update your custom CSS...
Read more >
Bigtop Project Release Notes
[BIGTOP-3669] - Use maven instead of ant to build ZooKeeper ... [BIGTOP-3643] - Upgrade ubuntu version example in gradle task description ...
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