ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.52k stars 1.82k forks source link

TypeError: Cannot read properties of undefined (reading 'javaScript') #310

Closed unional closed 1 year ago

unional commented 1 year ago

On WSL With Node 18.12.1 With puppeteer 13.7.0 With estimo 2.3.6 With size-limit 8.0.1

Error: Failed to launch the browser process! spawn /home/homa/code/mocktomata/node_modules/.pnpm/estimo@2.3.6/node_modules/estimo/temp/chrome/linux-982053/chrome-linux/chrome ENOENT

✖ Running JS in headless Chrome
ERROR  TypeError: Cannot read properties of undefined (reading 'javaScript')
  at getTime (/home/homa/code/mocktomata/mocktomata/node_modules/.pnpm/@size-limit+time@8.0.1_size-limit@8.0.1/node_modules/@size-limit/time/get-running-time.js:29:22)

on this line:

let estimo = require('estimo')

...

  value += perf[0].javaScript / 1000
ai commented 1 year ago

Seems like you need to report to estimo since it send back undefined

unional commented 1 year ago

Sure. I checked and it returns [] The file under check is: /tmp/size-limit-DnCRqgCfYvwJ1rc8ocpJI/index.js

unional commented 1 year ago

Since the downstream issue might take some time to fix, should we fix the usage here? default the value to 0, and maybe emit a warning about it. The filename /tmp/size-limit-DnCRqgCfYvwJ1rc8ocpJI/index.js might not make much sense in the warning thou.

ai commented 1 year ago

If value is 0 it is still an issue. We can’t process it with a rational results.

unional commented 1 year ago

Is there a way to disable the time tracking?

It's blocking me from releasing my package. :( https://github.com/mocktomata/mocktomata/actions/runs/4159708870/jobs/7196155664

UPDATE: it goes through on 3rd try...

ai commented 1 year ago

Just avoid the time plugin (you may need to change the preset).

unional commented 1 year ago

Just avoid the time plugin (you may need to change the preset).

Sure. Changed from @size-limit/preset-big-lib to @size-limit/preset-small-lib. thx.