Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

fix: invalid underscore requires after 1.13 update (#989)

Ondra Urban058af35a8328
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c70ecd246..75173124d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
-NEXT
+1.1.2 / 2021/04/10
====================
-- **DEPRECATED:** `utils.waitForRunToFinish` please use `apify-client` and its `waitForFinish` functions. Sorry, forgot to deprecate this with v1 release.
+- **DEPRECATED:** `utils.waitForRunToFinish` please use the `apify-client` package and its `waitForFinish` functions. Sorry, forgot to deprecate this with v1 release.
+- Fix internal `require` that broke the SDK with `underscore` 1.13 release.
+- Update `@apify/storage-local` to v2 written in TypeScript.
1.1.1 / 2021/03/23
====================
diff --git a/package.json b/package.json
index 367b72ee9..1f9995c4c 100644
--- a/package.json
+++ b/package.json
@@ -77,7 +77,7 @@
"socket.io": "^3.0.3",
"stream-json": "^1.7.1",
"tough-cookie": "^4.0.0",
- "underscore": "^1.11.0",
+ "underscore": "^1.13.0",
"ws": "^7.3.1"
},
"devDependencies": {
@@ -106,11 +106,11 @@
"fpscanner": "^0.1.5",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
- "playwright": "1.10.0",
+ "playwright": "1.7.1",
"portastic": "^1.0.1",
"prettier": "^2.1.2",
"proxy": "^1.0.2",
- "puppeteer": "8.0.0",
+ "puppeteer": "6.0.0",
"sinon": "^9.2.0",
"sinon-stub-promise": "^4.0.0",
"socket.io-client": "^3.0.3",
diff --git a/src/puppeteer_utils.js b/src/puppeteer_utils.js
index bacb3e25d..31425c687 100644
--- a/src/puppeteer_utils.js
+++ b/src/puppeteer_utils.js
@@ -12,8 +12,8 @@ import { enqueueLinksByClickingElements } from './enqueue_links/click_elements';
import { addInterceptRequestHandler, removeInterceptRequestHandler } from './puppeteer_request_interception';
import { openKeyValueStore } from './storages/key_value_store';
-const jqueryPath = require.resolve('jquery/dist/jquery.min');
-const underscorePath = require.resolve('underscore/underscore-min');
+const jqueryPath = require.resolve('jquery');
+const underscorePath = require.resolve('underscore');
const readFilePromised = util.promisify(fs.readFile);
const MAX_INJECT_FILE_CACHE_SIZE = 10;