[bug]: Custom Field Functions in Dev Mode but Fails in Start Mode
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- sqlite, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 24
- Forks
- 13
- Merge medio
- 5 d 3 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de strapi/sdk-plugin
-
Dificultad 4/5 Medio día Aptitud para principiantes 15/100
strapi/sdk-plugin#244 ·
Los mantenedores suelen responder en 6 días
-
[bug]: build ignores exports file names and package.json#type, breaking "type": "module" pluginsPosiblemente ocupada @unrevised6419 la tomó hace 44 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
strapi/sdk-plugin#242 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
strapi/sdk-plugin#241 ·
Los mantenedores suelen responder en 6 días
-
[feat]: build a subset of bundles with --bundle, for per-bundle task cachingPosiblemente ocupada @unrevised6419 la tomó hace 51 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
strapi/sdk-plugin#238 ·
Los mantenedores suelen responder en 6 días
-
[bug]: When building with latest sdk-plugin version, I loose sub folders typesQuizá libre de nuevo @jhoward1994 la tomó hace 247 días y no hay ningún pull request abierto. Abiertoissue: bug
strapi/sdk-plugin#115 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 6 días
Todos los issues de strapi/sdk-plugin
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AykutSarac/jsoncrack.com#616 ·
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtagPosiblemente ocupada @bardrop la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nbd-wtf/nostr-tools#578 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
backnotprop/plannotator#3427 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/Power-CAT-Copilot-Studio-Kit#942 ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/DebateAI#801 · 1 comentario ·
Los mantenedores suelen responder en 1 día