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

TypeError: Cannot read property 'entries' of undefined #314

Open
sarbbottam opened this issue May 27, 2020 · 10 comments
Open

TypeError: Cannot read property 'entries' of undefined #314

sarbbottam opened this issue May 27, 2020 · 10 comments

Comments

@sarbbottam
Copy link

npx ember-native-class-codemod https://<host>:<port>/path/ app/**/*.js

The process hangs after the following error.

Downloading Chromium r686378 - 110.2 Mb [====================] 100% 0.0s 
(node:58858) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'entries' of undefined
    at __puppeteer_evaluation_script__:7:48
    at ExecutionContext._evaluateInternal (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async ExecutionContext.evaluate (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
    at async gatherTelemetry (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/ember-codemods-telemetry-helpers/lib/gather/gather-telemetry.js:15:21)
    at async /Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/bin/cli.js:7:3
  -- ASYNC --
    at ExecutionContext.<anonymous> (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/helper.js:111:15)
    at DOMWorld.evaluate (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/DOMWorld.js:112:20)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
  -- ASYNC --
    at Frame.<anonymous> (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.evaluate (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/Page.js:833:43)
    at Page.<anonymous> (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/puppeteer/lib/helper.js:112:23)
    at gatherTelemetry (/Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/node_modules/ember-codemods-telemetry-helpers/lib/gather/gather-telemetry.js:15:32)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /Users/sabandyo/.npm/_npx/58858/lib/node_modules/ember-native-class-codemod/bin/cli.js:7:3
(node:58858) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:58858) [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.
@rwjblue
Copy link
Member

rwjblue commented Jun 1, 2020

I suspect what is happening is that the browser we are launching is not actually ending up on the Ember application. Often times this is due to being redirected to an external login page, or something like that.

Maybe you could navigate to /tests instead of your main application landing page?

@basz
Copy link

basz commented Jun 8, 2020

I'm seeing this as well. Pointing to a different path isn't any different... My app isn't redirecting either...

a yarn global remove/add of ember-native-class-codemod@1.1.0 did not help

@sarbbottam
Copy link
Author

As suggested by @rwjblue npx ember-native-class-codemod https://<host>:<port>/tests/ app/**/*.js worked for me.

@basz
Copy link

basz commented Jun 9, 2020

Well it does not for me... :) can we reopen?

@sarbbottam sarbbottam reopened this Jun 9, 2020
@sarbbottam
Copy link
Author

Reopened as requested by @basz.

@nezmen
Copy link

nezmen commented Jun 10, 2020

I am also getting this error and pointing to the test page is not working.

image
image

@TomaszWegrzyn
Copy link

Above problem is the same as in #242, I believe they just need to update ember-codemods-telemetry-helpers in order to fix it.

@rjschie
Copy link

rjschie commented Jul 14, 2020

I was getting this error as well and found it was due to the use of optional chaining in our apps and building to targets of last 1 Chrome versions.

This depends on puppeteer@1.20.0 which uses Chrome 78 and optional chaining was added in Chrome 80.

Upgrading this to puppeteer@latest worked for me to be able to run my code. I've opened a PR as well.

@jelhan
Copy link

jelhan commented Jul 19, 2020

This error seems to have different causes. For me disabling fastboot on the ember serve instance helped: FASTBOOT_DISABLED=true ember serve.

Confused myself. It was not Fastboot but making sure that config/target.js includes Chrome 78. So it's the same as reported by @rjschie. Hope his fix lands soon.

@BryanCrotaz
Copy link

BryanCrotaz commented Dec 9, 2020

I'm getting this error with
node v12.16.1 (happens in node 9 and 10 too)
It's downloading chromium r686378

Had to change config/targets.js to "last 10 chrome versions"

Now I get Cannot read property 'exports' of undefined instead. Progress of a sort...

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

8 participants