Skip to content
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

Preprocessor dependency "sass" failed to load: Cannot read properties of undefined (reading 'pop') #3102

Closed
4 tasks done
tomiaa12 opened this issue Oct 19, 2023 · 5 comments
Closed
4 tasks done
Labels
bug Something isn't working upstream Related to the dependencies

Comments

@tomiaa12
Copy link

Describe the bug

vitepress@0.0.0 dev
vitepress dev src

vitepress v1.0.0-rc.22

➜ Local: http://localhost:5173/
➜ press h to show help
Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'indexOf')
Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'pop')
Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'pop') (x2)
09:36:03 [vitepress] Internal server error: Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'pop')
Plugin: vite:css
File: F:/github/blog/src/style/index.scss
at Object. (F:\github\blog\node_modules.pnpm\sass@1.69.3\node_modules\sass\sass.node.js:2:43)
at Module.compile (node:internal/modules/cjs/loader:1369:14)
at Module.extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1201:32)
at Module.load (node:internal/modules/cjs/loader:1017:12)
at Module.require (node:internal/modules/cjs/loader:1229:19)
at require (node:internal/modules/helpers:177:18)
at loadPreprocessor (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11
@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:39294:45)
at scss (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11
@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:39340:20)
at compileCSSPreprocessors (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11
@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:38765:36)
at loadPreprocessor (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:39302:29)
at scss (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:39340:20)
at compileCSSPreprocessors (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:38765:36)
at compileCSS (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:38815:42)
at async TransformContext.transform (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:38295:56)
at async Object.transform (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:44345:30)
at async loadAndTransform (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:55015:29)
at async viteTransformMiddleware (file:///F:/github/blog/node_modules/.pnpm/vite@4.4.11_@types+node@18.18.5_sass@1.69.3/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:64417:32)
Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'pop')
Preprocessor dependency "sass" failed to load:
Cannot read properties of undefined (reading 'pop') (x2)

Reproduction

https://github.com/tomiaa12/blog

Expected behavior

正常打开页面

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
    Memory: 2.93 GB / 15.64 GB
  Binaries:
    Node: 21.0.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.9.2 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (118.0.2088.46)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vitepress: 1.0.0-rc.22 => 1.0.0-rc.22

Additional context

No response

Validations

@tomiaa12 tomiaa12 added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 19, 2023
@tomiaa12
Copy link
Author

An error occurs when node21 is used, but node20 works properly

@brc-dd
Copy link
Member

brc-dd commented Oct 19, 2023

Seems like a vite bug. Are you able to use sass with a simple vite project on node 21?

@brc-dd brc-dd added bug Something isn't working upstream Related to the dependencies and removed bug: pending triage Maybe a bug, waiting for confirmation labels Oct 19, 2023
@brc-dd
Copy link
Member

brc-dd commented Oct 19, 2023

Please track vitejs/vite#14691

@brc-dd brc-dd closed this as completed Oct 19, 2023
@brc-dd
Copy link
Member

brc-dd commented Oct 19, 2023

It's an issue with sass dart - track dart-lang/sdk#53784

@volnet
Copy link

volnet commented Oct 19, 2023

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

3 participants