Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is a bug where `sass.compile` will throw with an extremely unhelpful error trace when running in Jest [[1]]. > TypeError: J.getInterceptor$ax(...).map$1$1 is not a function > > at Object.map$1$1$ax (node_modules/sass/sass.dart.js:24513:44) > at listDir_closure0.call$0 (node_modules/sass/sass.dart.js:87066:18) > at Object._systemErrorToFileSystemException0 (node_modules/sass/sass.dart.js:20776:23) > at Object.listDir0 (node_modules/sass/sass.dart.js:20771:16) > at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:84710:34) > at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27273:24) > at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:84699:32) > at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:84706:35) > at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27273:24) > at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:84699:32) It has been suggested that it is related to `path.absolute` being overridden by the jsdom environment [[2]], but the workaround of using the "node" environment does not solve the issue for us. Instead, what did work is using the legacy API [[3]]. I'm not sure why this is, but it seems to do the trick. Note that with the legacy API, the file path is part of the options object, rather than being the first argument. If you forget to change the call signature, you will get a different unhelpful error message: > NoSuchMethodError: method not found: 'call' [1]: sass/dart-sass#1692 [2]: sass/dart-sass#710 (comment) [3]: https://sass-lang.com/documentation/js-api#legacy-api
- Loading branch information