Empty test causes writableLength undefined error
See original GitHub issueDescribe the bug
I get this even with nothing but an empty test('', () => {})
in my test file:
text|nate/dev⚡ ⇒ yarn test
$ test
$ vitest --config ../vite-plugin-internal/vite.config.ts
DEV v0.17.1 /Users/n8/tamagui/packages/text
✓ src/wrapChildrenInText.test.tsx (2)
Test Files 1 passed (1)
Tests 2 passed (2)
Time 803ms (in thread 1ms, 80323.73%)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Vitest caught 1 unhandled error during the test run. This might cause false positive tests.
Please, resolve all the errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: Errors occurred while running tests. For more information, see serialized error.
❯ Object.runTests ../../node_modules/vitest/dist/chunk-vite-node-externalize.0fc8ed68.mjs:7046:17
❯ processTicksAndRejections node:internal/process/task_queues:96:5
❯ async file:/Users/n8/tamagui/node_modules/vitest/dist/chunk-vite-node-externalize.0fc8ed68.mjs:10428:9
❯ Vitest.runFiles ../../node_modules/vitest/dist/chunk-vite-node-externalize.0fc8ed68.mjs:10441:12
❯ Vitest.start ../../node_modules/vitest/dist/chunk-vite-node-externalize.0fc8ed68.mjs:10362:5
❯ startVitest ../../node_modules/vitest/dist/chunk-vite-node-externalize.0fc8ed68.mjs:11110:5
❯ CAC.start ../../node_modules/vitest/dist/cli.mjs:666:9
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: {
"errors": [
[TypeError: Cannot read properties of undefined (reading 'writableLength')],
],
}
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit
Reproduction
git clone git@github.com:tamagui/tamagui.git
cd tamagui
./script/ci-prepare.sh
yarn
cd packages/text
yarn test
System Info
System:
OS: macOS 12.4
CPU: (8) arm64 Apple M1
Memory: 81.06 MB / 16.00 GB
Shell: 5.8 - /opt/homebrew/bin/zsh
Binaries:
Node: 16.14.0 - ~/Library/Caches/fnm_multishells/69747_1653603955297/bin/node
Yarn: 3.2.1 - ~/Library/Caches/fnm_multishells/69747_1653603955297/bin/yarn
npm: 8.3.1 - ~/Library/Caches/fnm_multishells/69747_1653603955297/bin/npm
Watchman: 2022.06.27.00 - /opt/homebrew/bin/watchman
Browsers:
Brave Browser: 103.1.40.113
Chrome: 102.0.5005.61
Firefox: 100.0.2
Safari: 15.5
Safari Technology Preview: 16.0
Used Package Manager
yarn
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.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Stream | Node.js v19.3.0 Documentation
The 'error' event is emitted if an error occurred while writing or piping data. The listener callback is passed a single Error argument...
Read more >TypeError: Cannot read property 'create' of undefined error
Hi I am creating NodeJS service with postgreSQL. When I trying to test POST method using postman. I got following error. Can you...
Read more >Array.prototype.length - JavaScript - MDN Web Docs
When length is set to a bigger value than the current length, the array is extended by adding empty slots, not actual undefined...
Read more >AWS Lambda function errors in Node.js
This page describes how to view Lambda function invocation errors for the Node.js runtime using the Lambda console and the AWS CLI.
Read more >Best Practices for Node.js Error-handling - Toptal
A good example is to try to read a property of “undefined. ... They force you to check errors all the way down...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm this is something to do with the CLI output, using
--reporter json
doesn’t produce the error.Still, I am not able to reproduce the error with reproduction steps that were provided.