The community member is using the crawlee package in a Node.js project and is encountering a TypeError: Dataset is not a constructor error. They have tried different approaches, such as changing the import statement and moving the Dataset to a separate require statement, but the issue persists. The community member is unsure if they need to make changes to the package.json file or what the problem might be.
In the comments, another community member suggests that the issue might be related to the use of the import statement outside of a module. They recommend adding the line "type" : "module" at the end of the package.json file to fix this problem.
when using crawlee in a node.js project (npm i crawlee), I keep getting this error with my code : (cheerio crawler, btw) TypeError: Dataset is not a constructor
from this section in my scraper code: const { CheerioCrawler } = require('crawlee'); const Dataset = require('crawlee').dataset;
i changed it from import { CheerioCrawler, Dataset } from 'crawlee'; to const { CheerioCrawler } = require('crawlee');
and tried moving the dataset too in its separate require statement but i'm getting this error
this is not in a my-crawler folder and not made with "npx crawlee create my-crawler" this is node.js project that i downloaded the crawlee package to with "npm i crawlee" is there something i need to change with the package.json or what's the problem?