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

Clueless clipper #4

Closed
konzatech opened this issue Jun 5, 2020 · 3 comments
Closed

Clueless clipper #4

konzatech opened this issue Jun 5, 2020 · 3 comments

Comments

@konzatech
Copy link

I absolutely love this response to making us "clip" electronic coupons. I'm a semi-retired Solaris and Linux systems admin, but not a skilled javascript developer. When I try to use your tool, I get the following. I am clueless and would appreciate any help getting your coupon clipper to work. Other than redacting my Publix password, this is the output I get. I'm running this on Linux Mint.

Thanks!

$ npx publix-coupon-clipper jeff.hanck@gmail.com ************
Downloading Chromium r722234 - 121.1 Mb [====================] 100% 0.0s
(node:30284) UnhandledPromiseRejectionWarning: ReferenceError: URL is not defined
at Page.filterRequests (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/dist/index.node.js:85:15)
at emitOne (events.js:116:13)
at Page.emit (events.js:211:7)
at NetworkManager.Page.networkManager.on.event (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/Page.js:110:68)
at emitOne (events.js:121:20)
at NetworkManager.emit (events.js:211:7)
at NetworkManager._onRequest (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/NetworkManager.js:234:10)
at NetworkManager._onRequestPaused (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/NetworkManager.js:210:12)
at emitOne (events.js:116:13)
at CDPSession.emit (events.js:211:7)
(node:30284) 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:30284) [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.
{ TimeoutError: Navigation timeout of 30000 ms exceeded
at Promise.then (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21)
at
-- ASYNC --
at Frame. (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/helper.js:111:15)
at Page.goto (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/Page.js:672:49)
at Page. (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/node_modules/puppeteer/lib/helper.js:112:23)
at logInToPublix (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/dist/index.node.js:116:14)
at clipCoupons (/home/jeff/.npm/_npx/30284/lib/node_modules/publix-coupon-clipper/dist/index.node.js:57:11)
at
at process._tickCallback (internal/process/next_tick.js:188:7) name: 'TimeoutError' }

@davecardwell
Copy link
Owner

Hi there! The error seems to be ReferenceError: URL is not defined.

Please could you let me know what version of node you’re running? (node -v)

From the “History” table under https://nodejs.org/api/url.html#url_the_whatwg_url_api it sounds like it was added to Node.js in v6.13.0 and v7.0.0 but only made globally available in v10.0.0 as I am using it.

davecardwell added a commit that referenced this issue Jun 5, 2020
The WHATWG-compatible `URL` class was added in Node.js v6.13.0/v7.0.0,
but was not made a global until v10.0.0. By explicitly importing it from
the `url` module we can support older versions of Node.js.
github-actions bot pushed a commit that referenced this issue Jun 5, 2020
## [2.1.2](v2.1.1...v2.1.2) (2020-06-05)

### Bug Fixes

* ensure URL is imported for node.js < v10 ([#4](#4)) ([6b990a6](6b990a6))
@davecardwell
Copy link
Owner

That did seem to be the issue. I installed Node.js v8.16.0 and was able to reproduce the problem, so fixed it in 6b990a6.

I published v2.1.2 to npm so it should be available when you run npx publix-coupon-clipper once the release has worked its way through their systems.

@davecardwell
Copy link
Owner

Oh, and thanks for the report @konzatech!

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