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

Error running size-limit #209

Closed
everdimension opened this issue Dec 28, 2020 · 3 comments
Closed

Error running size-limit #209

everdimension opened this issue Dec 28, 2020 · 3 comments

Comments

@everdimension
Copy link

Hi!

I followed the instructions for JS Applications https://github.com/ai/size-limit#js-applications

When running the ./node-modules/.bin/size-limit command, I get errors with the following output:

the-project git:master × ./node_modules/.bin/size-limit
⠙ Running JS in headless ChromeTimeoutError: waiting for target failed: timeout 30000ms exceeded
    at Object.waitWithTimeout (/projects/the-project/node_modules/puppeteer-core/lib/cjs/puppeteer/common/helper.js:224:26)
    at Browser.waitForTarget (/projects/the-project/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Browser.js:269:45)
    at ChromeLauncher.launch (/projects/the-project/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js:100:27)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async createBrowserEntity (/projects/the-project/node_modules/estimo/src/create-chrome-trace.js:27:19)
    at async createChromeTrace (/projects/the-project/node_modules/estimo/src/create-chrome-trace.js:85:15)
    at async processor (/projects/the-project/node_modules/estimo/src/processor.js:78:19)
    at async estimo (/projects/the-project/node_modules/estimo/src/lib.js:12:32)
    at async getTime (/projects/the-project/node_modules/@size-limit/time/get-running-time.js:18:14)
    at async Promise.all (index 10)
TypeError: Cannot read property 'close' of undefined
    at createChromeTrace (/projects/the-project/node_modules/estimo/src/create-chrome-trace.js:106:19)
✖ Running JS in headless Chrome
 ERROR  TypeError: Cannot read property 'javaScript' of undefined
    at getTime (/projects/the-project/node_modules/@size-limit/time/get-running-time.js:29:22)
    at async Promise.all (index 10)
    at async sum (/projects/the-project/node_modules/@size-limit/time/index.js:8:11)
    at async Object.step80 (/projects/the-project/node_modules/@size-limit/time/index.js:28:23)
    at async Promise.all (index 0)
    at async step (/projects/the-project/node_modules/size-limit/calc.js:15:13)
    at async calc (/projects/the-project/node_modules/size-limit/calc.js:44:36)
    at async calcAndShow (/projects/the-project/node_modules/size-limit/run.js:62:7)
    at async module.exports (/projects/the-project/node_modules/size-limit/run.js:67:5)

@ai
Copy link
Owner

ai commented Dec 28, 2020

Try a different preset. Seems like you have a problem with headless Chrome to detect execution time.

@ai
Copy link
Owner

ai commented Dec 28, 2020

Here is the possible quick solution for you:

  1. npm uninstall @size-limit/preset-app
  2. npm install @size-limit/file
  3. Avoid time in Size Limit config and use limit with bytes.

If you want a JS time execution limit, you need to open an issue at estimo (our Chrome headless runner)
https://github.com/mbalabash/estimo

@ai ai closed this as completed Dec 28, 2020
@everdimension
Copy link
Author

Thank you!

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

2 participants