Cypress configs are CommonJS under root "type": "module" and will fail to load
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cypress, javascript, node.js
- Lĩnh vực
- testing
Hướng nghiên cứu
Bắt đầu bằng cách đọc package.json ở thư mục gốc và cypress/plugins/index.js để xác nhận xung đột kiểu module được mô tả trong issue. Kiểm tra cách tệp plugin Cypress được tải, sau đó chọn một trong các cách sửa một dòng được đề xuất. Công việc hoàn tất khi plugin được tải dưới dạng hàm với cấu hình ESM ở thư mục gốc; hãy xác minh bằng lệnh Node được mô tả hoặc một kiểm tra Cypress phù hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found while verifying #2221. Not a regression from that PR — it's pre-existing and currently latent, since no CI job runs Cypress.
The problem
Root package.json declares "type": "module" (re-added in f42f6fce, the ESM test-suite migration). That makes Node treat every .js under the repo root as ESM — including cypress/plugins/index.js, which is still CommonJS (module.exports = (on, config) => {...}).
cypress/support/index.js is comments-only today, so it's currently harmless, but it's in the same trap the moment anyone adds code to it.
Verified on development with Node v24.14.0:
$ node -e "console.log(typeof require('./cypress/plugins/index.js'))"
object
require() returns an empty namespace object instead of the exported function, so anything that loads the plugins file the way Cypress does will get a non-function — the same failure #2221 fixes for github-actions/pr-instructions/.
Suggested fix
Pick one, all are one-liners:
- rename
cypress/plugins/index.js→cypress/plugins/index.cjs(what #2221 does), or - add
cypress/package.jsoncontaining{ "type": "commonjs" }to scope the subtree back to CJS, or - relocate the file under a directory that already has a CJS
package.json.
The cypress/package.json route is the more durable one, since it protects future files added under cypress/ automatically.
Not affected — checked already
shared/roles.jsandshared/authorizationUtils.jsalso containmodule.exports, but they're guarded withif (typeof module !== "undefined" && module.exports)and import each other as ESM, so they load correctly either way.backend/has its ownpackage.jsonwith"type": "module".client/has notypefield, so its CJS configs (postcss.config.js,tailwind.config.js,setupProxy.js) are fine.
The only real breakage in the root tree is the Cypress plugins file.
- Ngôn ngữ chính
- JavaScript
- Star
- 62
- Fork
- 105
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hackforla/VRMS
-
complexity: small feature: Infrastructure p-feature: User Permissions role: Front End size: 0.25pt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Login form inputs lack visible focus indicator for keyboard navigationCó thể đã có người làm @mvanhorn đã nhận 161 ngày trước. Đang mởBug complexity: medium good first issue p-feature: Login role: Front End size: 1pt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 4 ngày
-
complexity: medium feature: Login role: devops size: 1pt
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 4 ngày
-
complexity: small p-feature: Onboarding role: Front End size: 0.25pt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
hackforla/VRMS#2105 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
WR Add Pull Request Instructions fails at artifact download (401) on its first ever runCó thể đã có người làm @trillium đã nhận 1 ngày trước. Đang mởBug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của hackforla/VRMS
Issue tương tự
-
Code Cleanup Dev Environment
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ProjectSidewalk/SidewalkWebpage#5699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zenstackhq/zenstack#2873 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Jason-Vaughan/TangleClaw#2195 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update: freelancermapĐang mởpermissions in review update icon/data
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
simple-icons/simple-icons#15062 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[cao] CAO validation findingsĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
githubnext/gh-aw-cao#16664 ·
Maintainer thường phản hồi trong vòng 1 ngày