-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Thanks for this great package! 😄
Expectation
From README.md:
Compatible with node.js and browsers
Problem
However, it imports from "util", which is only available in Node JS:
Line 2 in 629c06d
| import { inspect } from "util"; |
And I'm seeing this error in some of my projects:
Uncaught TypeError: util_1.inspect is undefined
Reproduction
Here is a very minimal Vite project that demonstrates the problem: repro.zip
npm installnpm run buildNote the warning above. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.> vite-starter@0.0.0 build > vite build vite v5.1.6 building for production... [plugin:vite:resolve] [plugin vite:resolve] Module "util" has been externalized for browser compatibility, imported by "/home/dolf/tmp/20240315-make-error-cause/repro/node_modules/make-error-cause/dist/index.js". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details. ✓ 11 modules transformed. dist/index.html 0.25 kB │ gzip: 0.19 kB dist/assets/index-B4nqUxqB.js 7.73 kB │ gzip: 2.32 kB ✓ built in 84msnpm run preview- Open browser and look in the console to see the error:

Here you can see in the built code where it happened:

Possible solution
Coming soon ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels