-
-
Notifications
You must be signed in to change notification settings - Fork 286
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Please provide the environment you discovered this bug in.
Reproduction: https://github.com/diegovilar/analog-scss-issue
Which area/package is the issue in?
vite-plugin-angular
Description
It seems like vite-plugin-angular doesn't work correctly with SCSS when it comes to using @use
, @import
and @forward
. It seems to be mixing sync and async APIs from both sass and sass-embedded (tried both). This works as expected with a pure vite setup, but not when using the analog plugin.
Reproduction repo: https://github.com/diegovilar/analog-scss-issue
Steps do reproduce:
- Create a new project with
pnpm create [email protected]
- 49732e7 - Switch the setup from CSS to SCSS and try to
@use
another SCSS file - 15a5c14 - Serve and open the app to see the error
Please provide the exception or error you saw
[plugin:vite:css] [sass] Error: The importer must return an absolute URL, was "[object Promise]"
╷
1 │ @use "./styles/global" as *;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
/home/dev/workspace/analog-project/src/styles.scss 1:1 root stylesheet
at handleCompileResponse (/home/dev/workspace/analog-project/node_modules/.pnpm/[email protected]/node_modules/sass-embedded/dist/lib/src/compiler/utils.js:155:15)
at AsyncCompiler.compileRequestAsync (/home/dev/workspace/analog-project/node_modules/.pnpm/[email protected]/node_modules/sass-embedded/dist/lib/src/compiler/async.js:100:54)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.run (file:///home/dev/workspace/analog-project/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:32546:19)
at async process (file:///home/dev/workspace/analog-project/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:32574:20)
at async compileCSSPreprocessors (file:///home/dev/workspace/analog-project/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:32009:27)
at async compileCSS (file:///home/dev/workspace/analog-project/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:32037:30)
at async TransformPluginContext.handler (file:///home/dev/workspace/analog-project/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:31579:54)
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working