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

"node:http" doesn't implement "Server.unref()" API #19113

Closed
tigitz opened this issue May 12, 2023 · 1 comment · Fixed by #19201
Closed

"node:http" doesn't implement "Server.unref()" API #19113

tigitz opened this issue May 12, 2023 · 1 comment · Fixed by #19201
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@tigitz
Copy link

tigitz commented May 12, 2023

A simple crawling example from the documentation:

// Add import of CheerioCrawler
import { RequestQueue, CheerioCrawler } from 'npm:crawlee';

const requestQueue = await RequestQueue.open();
await requestQueue.addRequest({ url: 'https://crawlee.dev' });

// Create the crawler and add the queue with our URL
// and a request handler to process the page.
const crawler = new CheerioCrawler({
    requestQueue,
    // The `$` argument is the Cheerio object
    // which contains parsed HTML of the website.
    async requestHandler({ $, request }) {
        // Extract <title> text with Cheerio.
        // See Cheerio documentation for API docs.
        const title = $('title').text();
        console.log(`The title of "${request.url}" is: ${title}.`);
    }
})

// Start the crawler and wait for it to finish
await crawler.run();

Straight up raise the following error

error: Uncaught TypeError: server.server.unref is not a function
    at Object.<anonymous> (file:///home/deno/.cache/deno/npm/registry.npmjs.org/@crawlee/browser-pool/3.3.2/proxy-server.js:8:15)
    at Object.<anonymous> (file:///home/deno/.cache/deno/npm/registry.npmjs.org/@crawlee/browser-pool/3.3.2/proxy-server.js:19:4)
    at Module._compile (ext:deno_node/01_require.js:966:34)
    at Object.Module._extensions..js (ext:deno_node/01_require.js:999:10)
    at Module.load (ext:deno_node/01_require.js:877:32)
    at Function.Module._load (ext:deno_node/01_require.js:713:12)
    at Module.require (ext:deno_node/01_require.js:899:19)
    at require (ext:deno_node/01_require.js:1039:16)
    at Object.<anonymous> (file:///home/deno/.cache/deno/npm/registry.npmjs.org/@crawlee/browser-pool/3.3.2/playwright/playwright-plugin.js:13:24)
    at Object.<anonymous> (file:///home/deno/.cache/deno/npm/registry.npmjs.org/@crawlee/browser-pool/3.3.2/playwright/playwright-plugin.js:174:4)

Looking for this error in previous issues it might be related to:

@bartlomieju friendly ping for your April/May NPM compatibility list

@bartlomieju bartlomieju added bug Something isn't working correctly node compat labels May 12, 2023
@bartlomieju bartlomieju changed the title Using @crawlee with deno raises a server.server.unref is not a function "node:http" doesn't implement "Server.unref()" API May 13, 2023
@bartlomieju
Copy link
Member

@mmastrac any thoughts on implementing Deno.serve().unref()? It's probably useful to have it available on our server API and doing that would make fixing this issue a couple lines of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants