Module not found: Error: Can't resolve 'https'

未关闭
#24 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
nodejs, typescript, webpack
领域
build-system

调研方向

Reproduce the Node v20 webpack build and inspect node_modules/serpapi/esm/src/utils.js, where the missing https and querystring modules are reported. Determine whether the package or consuming build is expected to provide the resolution, then verify that the build completes without these errors.

由索引模型根据 Issue 内容生成。

描述

I get these error message for node v20
ERROR in ./node_modules/serpapi/esm/src/utils.js 2:0-26
Module not found: Error: Can't resolve 'https' in '/Users/yasaman/Desktop/safariz/node_modules/serpapi/esm/src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
ERROR in ./node_modules/serpapi/esm/src/utils.js 3:0-29
Module not found: Error: Can't resolve 'querystring' in '/Users/yasaman/Desktop/safariz/node_modules/serpapi/esm/src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
- install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "querystring": false }

主要语言
TypeScript
星标
95
派生
33
平均合并
8 天 12 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

serpapi/serpapi-javascript 的其他 Issue

查看 serpapi/serpapi-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。