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

Async error #243

Open
Yelinz opened this issue Feb 14, 2020 · 7 comments
Open

Async error #243

Yelinz opened this issue Feb 14, 2020 · 7 comments

Comments

@Yelinz
Copy link

Yelinz commented Feb 14, 2020

When i run any command this error comes up

(node:1259) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'entries' of undefined
    at __puppeteer_evaluation_script__:9:50
    at ExecutionContext._evaluateInternal (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  -- ASYNC --
    at ExecutionContext.<anonymous> (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/helper.js:111:15)
    at DOMWorld.evaluate (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/DOMWorld.js:112:20)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  -- ASYNC --
    at Frame.<anonymous> (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.evaluate (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/Page.js:833:43)
    at Page.<anonymous> (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/puppeteer/lib/helper.js:112:23)
    at bridgeEvaluate (/home/yelin/.npm/_npx/1259/lib/node_modules/ember-angle-brackets-codemod/node_modules/ember-codemods-telemetry-helpers/lib/gather/gather-telemetry.js:66:17)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1259) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1259) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@tomdrn
Copy link

tomdrn commented Feb 24, 2020

Go the exact same error, tried with release 4.1.0 and 3.1.2.

@abulrim
Copy link

abulrim commented Mar 23, 2020

@Yelinz can you show us the command you entered?

@Yelinz
Copy link
Author

Yelinz commented Mar 23, 2020

As i said any command, so whatever is in the README and any variation of it.
e.g. npx ember-angle-brackets-codemod http://localhost:4200 ./path/of/files/ or ./some**/*glob.hbs

@alexlafroscia
Copy link

I'm seeing the same issue -- if I run the following

npx ember-angle-brackets-codemod --telemetry=http://localhost:9999 ./addon

(Our app runs on port 9999, hence the slight different from the normal usage there)

I get the same error about entries being accessed on undefined.

My guess is that the issue is here:

https://github.com/ember-codemods/ember-codemods-telemetry-helpers/blob/a1ae780e23e9fec88112679d34277092e51690c2/lib/gather/gather-telemetry.js#L36

And that, for some reason, window.require is not yet defined at the point that that line is being evaluated.

@rjschie
Copy link

rjschie commented Jul 14, 2020

I was getting this as well and found it was due to the Puppeteer version using Chrome 78.0 and our build target was only to the last 1 Chrome version which made our build incompatible with Chrome 78.0.

@alexlafroscia
Copy link

Huh, good call-out there @rjschie! I bet that could be what the issue for me is, too -- our app is set up to just use the last 1 chrome version in development mode.

@alexlafroscia
Copy link

alexlafroscia commented Aug 18, 2020

Unfortunately we're still seeing the issue even with two different "fixes" attempted

  1. Setting our browsers list for the development build to Chrome >= 78
  2. Cloning the code-mod locally and overriding the dependency on ember-codemods-telemetry-helpers to pull from the master on GitHub, where an update to Puppeteer has landed thanks to @rjschie (the update hasn't actually been released to npm yet)

False alarm; an issue in our app's configuration was the reason it was breaking.

With the above steps applied, the codemod worked for me! 🎉

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

5 participants