Skip to content

SASS fails to compile files under Jest #1692

@TheLonelyAdventurer

Description

@TheLonelyAdventurer

Running sass.compile(path) wil throw a suspicious exception:

TypeError: J.getInterceptor$ax(...).map$1$1 is not a function

      at Object.map$1$1$ax (node_modules/sass/sass.dart.js:24596:44)
      at listDir_closure0.call$0 (node_modules/sass/sass.dart.js:87563:18)
      at Object._systemErrorToFileSystemException0 (node_modules/sass/sass.dart.js:20859:23)
      at Object.listDir0 (node_modules/sass/sass.dart.js:20854:16)
      at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:85221:34)
      at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27356:24)
      at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:85210:32)
      at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:85217:35)
      at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27356:24)
      at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:85210:32)

The code above was run using jest.

Basic code that reproduces the error:

const sass = require('sass');

const config =
	{ sourceMap: false
	, sourceMapIncludeSources: false
	, style: 'compressed'
	, verbose: true
	, logger: console
	, alertAscii: false
	, alertColor: true
	, functions: {}
	, importers: []
	, loadPaths: []
	, quietDeps: true
	};


function compile() {
	return sass.compile('test.scss');
}

console.log(compile());

The exact same code works when run outside jest.

I've tracked down the compiled js of sass up to this line of sass.dart.js:

immagine

which is called by:

immagine

which is in turn called by:

immagine

As expected these are the results in my debugger for checking the parameters:

immagine

I am not sure what map$1$1 is, but it seems to depend on the running environment as far as I understand the problem.

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