-
-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Labels
Description
Acknowledgements
- I read the documentation and searched existing issues to avoid duplicates
- I understand this is a bug tracker and anything other than a proven bug will be closed
- I understand this is a free project and relies on community contributions
- I read and understood the Contribution guide
Minimal reproduction URL
https://github.com/serkodev/tsx-issue-735
Problem & expected behavior (under 200 words)
When running a Nuxt build using TSX
import { runMain } from '@nuxt/cli'
runMain()The process fails with a sass-embedded error:
Nuxt Build Error: [vite:css] [sass] Cannot read properties of undefined (reading 'initAsyncCompiler')
From Reproduction Repo
Clone the repo and run:
pnpm i
# run with error
pnpm run build:tsxThe build works with no error when running the same .ts file via Bun or ts-node.
pnpm run build:bun
pnpm run build:ts-nodeFrom Scratch
Show all steps
-
Create an empty Nuxt project by
npm create nuxt@latest. -
Install dependencies:
pnpm i -D @nuxt/cli sass-embedded
-
Add a SCSS style in
app.vue:<style lang="scss"> body { color: red; } </style>
-
Create
nuxt.tswith:import { runMain } from '@nuxt/cli' runMain()
-
Run:
tsx ./nuxt.ts build
The error message will appear.
Bugs are expected to be fixed by those affected by it
- I'm interested in working on this issue