Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handleSummary() failed with error "TypeError: Not a function: [object Object]" #40

Open
320IM opened this issue Apr 10, 2022 · 5 comments

Comments

@320IM
Copy link

320IM commented Apr 10, 2022

Hi Bro, I am running with --compatibility-mode=base, got below error
handleSummary() failed with error "TypeError: Not a function: [object Object]", falling back to the default summary source=console

here is my code quiet simple just follow the demo

const htmlReport = require("https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js");
exports.handleSummary =  function (data) {
    return {
        "summary.html": htmlReport(data),
    };
}

k6 v0.36.0 ((devel), go1.17.6, darwin/arm64)

@akagupta9
Copy link

any update on this?

@benc-uk
Copy link
Owner

benc-uk commented Feb 24, 2023

Not touched k6 or this code in a few years, what is --compatibility-mode=base ?

@akagupta9
Copy link

what does --compatibility-mode=base mean?

@akagupta9
Copy link

tried with both - K6_COMPATIBILITY_MODE=base and K6_COMPATIBILITY_MODE=extended.

its same error.

@dayer4b
Copy link

dayer4b commented Aug 8, 2023

Just a user here, but I had some success with using the textSummary technique in the docs. But it also requires that you add this as an import:

import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.3/index.js';

export function handleSummary(data) {                                     
  // export a static HTML report _and_ make sure default output happens   
  return {                                                                
    'results/index.html': htmlReport(data),                               
    'stdout': textSummary(data, { indent: ' ', enableColors: true }),     
  };                                                                      
}                                                                         

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants