-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sass
dynamic import is undefined when building with "modern-compiler" and sass-embedded
#19052
Comments
I have encountered the same problem: [vite:css] [sass] Cannot read properties of undefined (reading 'initAsyncCompiler')
file: /GitHub/weapp-vite/apps/vite-native/app.scss
node:internal/process/promises:392
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
at processPromiseRejections (node:internal/process/promises:475:17)
at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v22.12.0 Reproductionhttps://github.com/weapp-vite/weapp-vite/tree/main/apps/vite-native Steps to reproduce
Used Package Managerpnpm System Info System:
OS: macOS 15.2
CPU: (14) arm64 Apple M4 Pro
Memory: 97.59 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn
npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
pnpm: 9.15.1 - ~/.nvm/versions/node/v22.12.0/bin/pnpm
Browsers:
Chrome: 131.0.6778.205
Safari: 18.2
npmPackages:
@vitejs/plugin-legacy: ^6.0.0 => 6.0.0
rollup: ^4.29.1 => 4.29.1 |
@cod1r It doesn't reproduce on my machine. Are you using some loaders like tsx or ts-node? |
i think you need to have sass-embedded installed which causes it to pass a different path to makeModernSassFunction or whatever it's called |
@cod1r Your reproduction contains
Are you using other runtimes than Node? e.g. Deno, Bun |
no. i just imported a sass file and did a vite build or w/e |
oh im an idiot. the link is not react lmao |
gimme one sec |
ok, the stackblitz thing is weird. but basically just have sass, sass-embedded, and try to build with those packages locally. probably will error due to above problem |
@cod1r would you make a GitHub repo that reproduces the error? |
i can ye. just gotta get day20 aoc. gimme some time |
seems like @ hi-ogawa had some reproducible repos linked in the PR i made |
I don't think hi-ogawa's reproduction is the one that reproduces the |
Hello @cod1r. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
👀 |
Not a reproduction, but it seems sass-embedded exports mjs file which is being used instead of default cjs. |
Describe the bug
I expect to do builds without any crashes relating to "sass" being an undefined import.
The actual behavior is that in css.ts, the dynamic import is expecting properties to be on the default export but instead properties are exported individually (named exports w/e you want to call it).
Reproduction
stackblitz link wasn't working out. had a different sass-embedded error lmaojust have sass files and try importing them and then doing a vite build with sass-embedded. the sass-embedded dynamic import will try to grab a default export but sass embedded doesn't have one
Steps to reproduce
System Info
Used Package Manager
yarn
Logs
The text was updated successfully, but these errors were encountered: