Comments (9)
@wencaizhang 对的,可以给 package.json 添加 "type": "module"
,tsconfig.json 添加 "module": "ESNext"
, "moduleResolution": "Bundler"
,
from x-crawl.
Message that will be displayed on users' first issue
from x-crawl.
你好,请打印一下 xCrawl 看看是否存在
from x-crawl.
@coder-hxl 你好,我也遇到了同样的问题,我是引入到 nestjs 项目中出现这个情况的,这里有一个复现仓库:
https://github.com/wencaizhang/nestjs-crawl-bug-demo
- Node 版本:v20.10.0
- pnpm 版本:8.11.0
- x-crawl:^10.0.1
from x-crawl.
@wencaizhang 建议提个新的 Issues ,新版改动还是蛮大的,我先克隆下来试试
from x-crawl.
@wencaizhang V10 版本已经不再支持 CJS ,只能使用 ESM ,https://github.com/coder-hxl/x-crawl/releases/tag/v10.0.0
from x-crawl.
@wencaizhang V10 版本已经不再支持 CJS ,只能使用 ESM ,https://github.com/coder-hxl/x-crawl/releases/tag/v10.0.0
这个项目是支持 ESM 的,例如 import { log } from '../utils';
按照 ESM 写法都是正常的。
但是具体到 x-crawl 我怎么写都不对。
from x-crawl.
@wencaizhang 最终打包是变成 CJS 的,可以看看 dist 目录下的文件
from x-crawl.
明白了,我的理解是现在 nestjs 中虽然是 ESM 写法:
import { createCrawl } from 'x-crawl';
但是实际仍然请求了 x-crawl
的 CJS 模块:
而这个模块只输出一个警告信息。
所以真正的问题应该是如何让 nestjs 引入 x-crawl
的 ESM 模块了。
from x-crawl.
Related Issues (20)
- 能否增加debug模式,在开发的时候,支持将浏览器显示出来? HOT 7
- Dependency Dashboard HOT 1
- 请问有跳转的文件下载如何处理 HOT 3
- pnpm 安装依赖报错 HOT 3
- xCrawl.crawlFile 函数不能完美的兼容linux HOT 6
- crawlData 的请求参数传递有问题 HOT 4
- Check this box to trigger a request for Renovate to run again on this repository HOT 1
- 这个是不能在centos服务器上使用吗?安装依赖的时候,无头浏览器一直安装不成功 HOT 4
- crawlPage setting proxy option does not work HOT 7
- 建议 crawlFile 的选项参数可支持字符串或数组 HOT 9
- 关于 `crawlFile` API 设计的想法建议 HOT 4
- crawlData配置问题 HOT 3
- crawlData中data参数为string HOT 1
- crawData 请求结果问题 HOT 3
- chore(deps): update dependency @rollup/plugin-terser to v0.4.3
- crawlPage 爬取多个 link 时, 返回结果是数组, 但是不知道每个结果对应的原始 url HOT 2
- 是否可以有个选项启用或者关闭打印的 Start Crawling/finish 信息 HOT 8
- 请问点击事件如何做呢 HOT 5
- windows正常的功能在Linux无结果无报错 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x-crawl.