Skip to content

bug: Throws an error if scss-file is empty #10

@m-abs

Description

@m-abs

We have a number of empty files in our project and we got this error when we tried to move to sass

TypeError: Cannot read property 'css' of undefined
    at /home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/lib/converter.js:74:39
    at Object.module.exports.render (/home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/node_modules/node-sass/lib/index.js:376:5)
    at parseSass (/home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/lib/converter.js:58:8)
    at loopSassFilesAsync (/home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/lib/converter.js:32:9)
    at /home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/lib/converter.js:41:13
    at /home/mabs/project/LYT3/nativescript/node_modules/nativescript-dev-sass/lib/converter.js:76:9
    at /home/mabs/.nvm/versions/node/v6.5.0/lib/node_modules/nativescript/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:99:16
    at /home/mabs/.nvm/versions/node/v6.5.0/lib/node_modules/nativescript/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:123:15)

The problem is that the var output in nativescript-dev-sass/lib/converter.js:32 is undefined, but you only check for null

I've made a temporary fix in our end, by adding dummy css to all the files. (our setup doesn't allow removal of the files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions