This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
TypeError: Cannot read property 'join' of undefined #1824
Copy link
Copy link
Closed
Description
I'm getting the following error when using node-sass programmatically:
/path/to/project/node_modules/node-sass/lib/index.js:177
return options.includePaths.join(path.delimiter);
^
TypeError: Cannot read property 'join' of undefined
at buildIncludePaths (/path/to/project/node_modules/node-sass/lib/index.js:177:30)
at getOptions (/path/to/project/node_modules/node-sass/lib/index.js:195:26)
at Object.module.exports.render (/path/to/project/node_modules/node-sass/lib/index.js:282:17)
I've created a reduced test case as follow:
var sass = require('node-sass');
sass.render('main.scss', function (err, results) {
if (err) {
return console.error(err);
}
console.log(results.css);
});
with main.scss
just contains
body {
margin: 0;
}
I tried to add some console log to the buildIncludePaths
function, and seeing the following output
/**
* Build an includePaths string
* from the options.includePaths array and the SASS_PATH environment variable
*
* @param {Object} options
* @api private
*/
function buildIncludePaths(options) {
console.log(options.includePaths);
console.log(options.includePaths || []);
options.includePaths = options.includePaths || [];
console.log(options.includePaths);
if (process.env.hasOwnProperty('SASS_PATH')) {
options.includePaths = options.includePaths.concat(
process.env.SASS_PATH.split(path.delimiter)
);
}
return options.includePaths.join(path.delimiter);
}
undefined
[]
undefined
/path/to/project/node_modules/node-sass/lib/index.js:177
return options.includePaths.join(path.delimiter);
^
When reporting an bug, you must provide this information:
- NPM version (
npm -v
): 3.10.9 - Node version (
node -v
): v7.1.0 - Node Process (
node -p process.versions
):
node: '7.1.0',
v8: '5.4.500.36',
uv: '1.10.0',
zlib: '1.2.8',
ares: '1.10.1-DEV',
modules: '51',
openssl: '1.0.2j',
icu: '58.1',
unicode: '9.0',
cldr: '30.0.2',
tz: '2016g' }
- Node Platform (
node -p process.platform
):darwin
- Node architecture (
node -p process.arch
):x64
- node-sass version (
node -p "require('node-sass').info"
):
node-sass 3.13.0 (Wrapper) [JavaScript]
libsass 3.3.6 (Sass Compiler) [C/C++]
- npm node-sass versions (
npm ls node-sass
):node-sass@3.13.0
Metadata
Metadata
Assignees
Labels
No labels