0

Any ideas about this error? I have started experiancing this after npm upgrade. It is probably related to https://github.com/vitejs/vite/issues/9238

"nuxt": "^3.0.0-rc.10",
"node-sass": "^7.0.1",
"sass": "^1.54.5",
"sass-loader": "^10.2.1"
Module "util" has been externalized for browser compatibility. Cannot access "util.inspect" in client code.
get @ browser-external:util:9

Uncaught TypeError: Cannot read properties of undefined (reading 'custom')
    at Object.JSClassExtension_setCustomInspect (sass.dart.js:21478:51)
    at valueClass_closure.call$0 (sass.dart.js:98709:9)
    at sass.dart.js:101365:85
    at holder.<computed> [as $get$valueClass] (sass.dart.js:258:21)
    at Object.main (sass.dart.js:21099:37)
    at main1 (sass.dart.js:21819:9)
    at sass.dart.js:101473:7
    at sass.dart.js:101456:7
    at dartProgram (sass.dart.js:101467:3)
    at exports.load (sass.dart.js:101475:1)

kissu
  • 40,416
  • 14
  • 65
  • 133
Jan Veselý
  • 1,329
  • 1
  • 15
  • 24
  • As [mentioned here](https://github.com/vitejs/vite/issues/9238#issuecomment-1195205461), maybe try to give a try to another package manager. Or give a try to [that answer](https://stackoverflow.com/a/70666018/8816585). Otherwise, why are you even using `node-sass` and `sass` at the same time? – kissu Sep 19 '22 at 13:56

1 Answers1

2

Webstorm has autoimported import {Exception} from "sass"; without my knowleadge into frontend component and browser tried to load sass module which caused the error.

kissu
  • 40,416
  • 14
  • 65
  • 133
Jan Veselý
  • 1,329
  • 1
  • 15
  • 24
  • Oh wow. I was going crazy trying to figure out what the issue was, in my case it did import { types } from 'sass'; – CWagner Jan 24 '23 at 07:37