question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: "Could not read results" on large result file?

See original GitHub issue

I have the following .betterer.ts:

import { typescript } from '@betterer/typescript';
import { eslint } from '@betterer/eslint';

export default {
  'stricter typescript': typescript('./tsconfig.json', {
    strict: true,
  }),

  'stricter eslint': eslint({
    '@typescript-eslint/ban-ts-comment': 'error',
    '@typescript-eslint/ban-types': 'error',
    '@typescript-eslint/explicit-function-return-type': 'error',
    '@typescript-eslint/explicit-module-boundary-types': 'error',
    '@typescript-eslint/no-empty-function': 'error',
    '@typescript-eslint/no-explicit-any': 'error',
    '@typescript-eslint/no-floating-promises': 'error',
    '@typescript-eslint/no-inferrable-types': 'error',
    '@typescript-eslint/no-redeclare': 'error',
    '@typescript-eslint/no-unnecessary-type-assertion': 'error',
    '@typescript-eslint/no-unsafe-assignment': 'error',
    '@typescript-eslint/no-unsafe-call': 'error',
    '@typescript-eslint/no-unsafe-member-access': 'error',
    '@typescript-eslint/no-unsafe-return': 'error',
    '@typescript-eslint/no-unused-vars': 'error',
    '@typescript-eslint/no-var-requires': 'error',
    '@typescript-eslint/prefer-optional-chain': 'error',
    '@typescript-eslint/restrict-plus-operands': 'error',
    '@typescript-eslint/restrict-template-expressions': 'error',
    '@typescript-eslint/strict-boolean-expressions': 'error',
    '@typescript-eslint/switch-exhaustiveness-check': 'error',
    '@typescript-eslint/unbound-method': 'error',
    'import/no-anonymous-default-export': 'error',
    'jsx-a11y/alt-text': 'error',
    'jsx-a11y/anchor-is-valid': 'error',
    'jsx-a11y/click-events-have-key-events': 'error',
    'jsx-a11y/label-has-associated-control': 'error',
    'jsx-a11y/no-autofocus': 'error',
    'jsx-a11y/no-noninteractive-element-interactions': 'error',
    'jsx-a11y/no-onchange': 'error',
    'jsx-a11y/no-static-element-interactions': 'error',
    'no-use-before-define': 'error',
    'react-hooks/exhaustive-deps': 'error',
    'react/jsx-no-target-blank': 'error',
    'react/prop-types': 'error',
  })
    .include('./Content/Scripts/**/*.{ts,tsx,js,jsx}'),
};

Running npx betterer the first time works fine, and the .betterer.results is generated. However, when I try to run it again, I get the following error:

   \ | /     _          _   _                     
 '-.ooo.-'  | |__   ___| |_| |_ ___ _ __ ___ _ __ 
---ooooo--- | '_ \ / _ \ __| __/ _ \ '__/ _ \ '__|
 .-'ooo'-.  | |_) |  __/ |_| ||  __/ | |  __/ |   
   / | \    |_.__/ \___|\__|\__\___|_|  \___|_|   
 
 ☀️  betterer  erro  🔥  -  could not read results from "C:\dev\projects\portal\OPF.Portal.Web\.betterer.results". 😔
  • If I delete .betterer.results, and .skip() the stricter eslint test, then it runs fine both times.
  • If I delete .betterer.results, and .skip() the stricter typescript test, then I get the same error.

In other words, the stricter eslint test caused the second run to fail, regardless of the stricter typescript being part of it or not.


Adding @betterer/eslint did make the .betterer.results file grow from ~2k lines to ~15k lines. So from from what I can gather, this must probably have something to do with how you’re trying to read that file? Is it running into some sort of size/buffer issue or something? Not sure why the file size should be an issue, but the way that file is read here does seem a bit… special… 🤔

I guess it could also be related to the format of the output from @betterer/eslint vs @betterer/typescript, but as far as I can see, those look pretty much identical, so… 🤷‍♂️

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phenomnomnominalcommented, Nov 3, 2020

Should be fixed in 3.1.2!

1reaction
phenomnomnominalcommented, Nov 2, 2020

Looks like you’ve found a pathological case for my file printing! I don’t just read the file as text, but I actually require it, so this issue here causes everything to break:

[250, 43, 25, "Unsafe member access [\`${key}Changed\`] on an any value.", "1548669727"]

Should be an easy fix, I’ll have a crack now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bash scripting and large files (bug): input with the read builtin ...
It appears that your're running bash on a 32-bit platform and your bash binary is not compiled with large file support. Now, when...
Read more >
Bugs in PHYLIP, known or recently fixed
Programs Dnaml and Proml sometimes failed to iterate branch lengths in trees enough -- this can result in them failing to find as...
Read more >
Unable to generate Dashboard report at end of load test
The product is not generating the HTML Dashboard report at the end of the test. I am pasting the Exception trace, Also writing...
Read more >
Interpret Bug Finder Results in Polyspace Desktop User ...
Organize results by file or result family. Use the icon above the list. Once you narrow down the list, you can begin reviewing...
Read more >
Indexer errors and warnings - Azure Cognitive Search
Error: Could not read document. Indexer was unable to read the document from the data source. This can happen due to: Reason, Details/ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found