skinny-azureS
Apify & Crawlee3y ago
8 replies
skinny-azure

Need help compiling crawlee in react

Hi everyone! I'm trying to integrate the crawlee library inside my react app for a social scrape project, but as soon as I import the PlaywrightCrawler module I get the following compile error:

ERROR in ./node_modules/@crawlee/browser/internals/browser-crawler.js
Module build failed (from ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js):
TypeError: /Applications/MAMP/htdocs/scouting/client/node_modules/@crawlee/browser/internals/browser-crawler.js: Cannot read properties of null (reading 'type')

Along with numerous warnings, all of the type:
WARNING in ./node_modules/proxy-chain/dist/forward.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Applications/MAMP/htdocs/scouting/client/node_modules/proxy-chain/src/forward.ts' file: Error: ENOENT: no such file or directory


I am using react 18.2.0 and node 16.19.1 version (>= 16, as specified by the documentation), for clarity here is also my package.json.

I already tried deleting /node_modules and package-lock.json and re-running
npm install
, but the problem persists. Anyone know how to fix? Thx!

package.json:
{
  "dependencies": {
    "@craco/craco": "7.1.0",
    "@hookform/resolvers": "3.0.0",
    "@reduxjs/toolkit": "^1.2.5",
    "autoprefixer": "10.4.5",
    "bootstrap": "5.2.3",
    "bs-stepper": "1.7.0",
    "classnames": "2.3.1",
    "craco": "0.0.3",
    "crawlee": "^3.0.1",
    "fs": "^0.0.1-security",
    "node-polyfill-webpack-plugin": "^2.0.1",
    "prismjs": "1.19.0",
    "prop-types": "15.7.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-hook-form": "7.43.7",
    "react-redux": "8.0.5",
    "react-router-dom": "6.2.2",
    "react-scripts": "5.0.1",
    "reactstrap": "9.0.1",
    "redux": "4.0.5",
    "sass": "1.32.13",
    "styled-components": "5.1.1",
    "yarn": "1.21.1",
    "yup": "1.0.2"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
  }
}
Was this page helpful?