You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the deprecated render API to process sass files (Vite still uses it), and also using meta.apply, it fails with (raw log):
Error: Bad state: Can't access __parent outside of a module.
at Object.wrapException (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:1252:43)
at _EvaluateVisitor2._async_evaluate0$_assertInModule$1$2 (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:80473:15)
at _EvaluateVisitor2._async_evaluate0$_assertInModule$2 (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:80476:19)
at /Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:81047:34
at _wrapJsFunctionForAsync_closure.$protected (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:4022:15)
at _wrapJsFunctionForAsync_closure.call$2 (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:33914:12)
at _awaitOnObject_closure.call$1 (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:33902:32)
at Object._rootRunUnary (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:4408:18)
at StaticClosure.<anonymous> (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:115526:16)
at _CustomZone.runUnary$2$2 (/Users/bjorn/Work/repros/vite-sass-test/node_modules/.pnpm/sass@1.69.5/node_modules/sass/sass.dart.js:35338:39)
Using compileString works fine. I'm not sure if it is intentional that this new feature doesn't work with the deprecated render API, but if so I think that's fair and just checking here.
Interestingly, renderSync() also works here, so it looks like it has something to do with the asynchrony specifically. Thanks for reporting this, I'll take a look.
When using the deprecated
render
API to process sass files (Vite still uses it), and also usingmeta.apply
, it fails with (raw log):Using
compileString
works fine. I'm not sure if it is intentional that this new feature doesn't work with the deprecatedrender
API, but if so I think that's fair and just checking here.Here's a repro comparing
compileString
andrender
: https://stackblitz.com/edit/stackblitz-starters-tirkhu?file=index.js (runnode index.js
to see error)This was originally reported at vitejs/vite#15443
The text was updated successfully, but these errors were encountered: