-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
When using preact, error stack traces show a location inside of minified code.
Example:
stack: 'Error: \n' +
' at HelloWorld (/home/projects/vitest-tests-browser-examples-mcpuv5wi/src/HelloWorld.tsx:2:9)\n' +
' at E (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/preact/dist/preact.mjs:25:9288)\n' +
' at O (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/preact/dist/preact.mjs:25:6220)\n' +
' at I (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/preact/dist/preact.mjs:25:1839)\n' +
' at O (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/preact/dist/preact.mjs:25:6502)\n' +
' at render (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/preact/dist/preact.mjs:25:9451)\n' +
' at null.<anonymous> (/home/projects/vitest-tests-browser-examples-mcpuv5wi/tests/HelloWorld.test.tsx:6:14)\n' +
' at <anonymous> (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/@vitest/runner/dist/index.js:191:11)\n' +
' at <anonymous> (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/@vitest/runner/dist/index.js:787:26)\n' +
' at <anonymous> (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/@vitest/runner/dist/index.js:1670:22)\n' +
' at <anonymous> (https://vitesttestsbrowserexamplesmcpu-hlwm.w-corp-staticblitz.com/blitz.cf284e50.js:31:27828)\n' +
' at _0x59a3b6 (https://vitesttestsbrowserexamplesmcpu-hlwm.w-corp-staticblitz.com/blitz.cf284e50.js:31:27787)\n' +
' at runWithTimeout (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/@vitest/runner/dist/index.js:1636:10)\n' +
' at runTest (file:///home/projects/vitest-tests-browser-examples-mcpuv5wi/node_modules/@vitest/runner/dist/index.js:1343:12)',
It's hard to understand what's going on if the stack trace points to preact.mjs:25:6220. To me, it seems like preact.mjs defines it's source map.
Reproduction
https://stackblitz.com/edit/vitest-tests-browser-examples-mcpuv5wi?file=package.json
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vitest: ^4.0.8 => 4.0.8Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)