ember-native-class-codemod
ember-native-class-codemod copied to clipboard
TypeError: Cannot read property 'entries' of undefined
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.
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?
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 [email protected] did not help
As suggested by @rwjblue npx ember-native-class-codemod https://<host>:<port>/tests/ app/**/*.js
worked for me.
Well it does not for me... :) can we reopen?
Reopened as requested by @basz.
I am also getting this error and pointing to the test page is not working.
Above problem is the same as in #242, I believe they just need to update ember-codemods-telemetry-helpers
in order to fix it.
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 [email protected] 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.
~~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.
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...