[bug]: Custom Field Functions in Dev Mode but Fails in Start Mode
Maintainer thường phản hồi trong vòng 6 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- sqlite, typescript
Hướng nghiên cứu
Reproduce the generated custom field with the stated Strapi and TypeScript setup in dev and start modes, then compare where useField obtains the Form context. Trace the generated field and start-mode initialization path; done means the custom field works without the Form-component error in start mode.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What version of @strapi/blocks-react-renderer are you using?
Node.js version: 18.17.0
NPM version: yarn/1.22.19
Strapi version: 5.0.0-rc.5
Database: sqlite
Operating system: darwin-arm64
Is your project Javascript or Typescript: Typescript
Plugin language: Typescript
What's Wrong?
The custom field works in dev mode but fails in start mode due to the useField hook not being able to find the Form context. This error (Uncaught Error: The Form Component has not been initialised, ensure you are using this hook within a Form component) indicates that the Form component or context provider is not properly initialized in start mode. This discrepancy often arises from differences in the build or initialization process between development and production environments.
To Reproduce
Add a custom field using the latest (5.0.1) plugin generator and try to use the useField helpers in both dev and start modes. In dev mode, everything works as expected. However, in start mode, you encounter the following error:
Uncaught Error: The Form Component has not been initialised, ensure you are using this hook within a Form component
This indicates that while the custom field functions correctly in dev mode, it fails in start mode due to the Form component or context not being properly initialized.
Expected Behaviour
No errors regarding custom field.
- Ngôn ngữ chính
- TypeScript
- Star
- 24
- Fork
- 13
- Merge trung bình
- 5 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 strapi/sdk-plugin
-
Độ khó 4/5 Nửa ngày Mức phù hợp với người mới 15/100
strapi/sdk-plugin#244 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
[bug]: build ignores exports file names and package.json#type, breaking "type": "module" pluginsCó thể đã có người làm @unrevised6419 đã nhận 44 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
strapi/sdk-plugin#242 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
strapi/sdk-plugin#241 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
[feat]: build a subset of bundles with --bundle, for per-bundle task cachingCó thể đã có người làm @unrevised6419 đã nhận 52 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
strapi/sdk-plugin#238 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
[bug]: When building with latest sdk-plugin version, I loose sub folders typesCó thể làm lại được @jhoward1994 đã nhận 248 ngày trước và không có pull request nào đang mở. Đang mởissue: bug
strapi/sdk-plugin#115 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của strapi/sdk-plugin
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
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 66/100
open-webui/tether#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`void platform install --app-access public` fails when Cloudflare reports Access is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/void#835 ·
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 72/100
AykutSarac/jsoncrack.com#616 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
melgarafael/DeskcommCRM#4679 ·
Maintainer thường phản hồi trong vòng 1 ngày