cuba-platform/frontend

Frontend build fails if to create "management-hooks" component for not persistent entity

IskandarovRost opened this issue · 0 comments

CUBA Platform version: 7.2.11
CUBA Studio plugin version: 15.2-202
IntelliJ version: IntelliJ IDEA 2020.2.4 (Community Edition)
Fron generator 4.0.0-beta.1 was used in the test

The same will be for

  • Not Persistent entity in CUBA
  • DTO entity in JMIX
  1. Create a not persistent entity. Like this:
    image.png
@MetaClass(name = "cubafront_NpEntity")
public class NpEntity extends BaseUuidEntity {
    private static final long serialVersionUID = 7284566424662342653L;

    @MetaProperty
    private String someFld;

    public String getSomeFld() {
        return someFld;
    }

    public void setSomeFld(String someFld) {
        this.someFld = someFld;
    }
}
  1. the "views" of the entity in projectModel.json
"views":[
   {
      "name":"_base",
      "entity":"cubafront_NpEntity",
      "classFqn":"com.company.cubafront.entity.NpEntity",
      "overwrite":false,
      "systemProperties":false,
      "properties":[
         
      ],
      "allProperties":[
         
      ]
   },
   {
      "name":"_local",
      "entity":"cubafront_NpEntity",
      "classFqn":"com.company.cubafront.entity.NpEntity",
      "overwrite":false,
      "systemProperties":false,
      "properties":[
         
      ],
      "allProperties":[
         
      ]
   },
   {
      "name":"_minimal",
      "entity":"cubafront_NpEntity",
      "classFqn":"com.company.cubafront.entity.NpEntity",
      "overwrite":false,
      "systemProperties":false,
      "properties":[
         
      ],
      "allProperties":[
         
      ]
   }
  1. Create Frontend entity-management-hooks component (see #4)
    image.png
  2. Start the application

AR: frontend build fails

> cubafront@0.1.0 build D:\projects\2021.02.22\cubafront\modules\front
> react-scripts build

Creating an optimized production build...
Failed to compile.

D:/projects/2021.02.22/cubafront/modules/front/src/app/npentity/NpEntityEdit.tsx
TypeScript error in D:/projects/2021.02.22/cubafront/modules/front/src/app/npentity/NpEntityEdit.tsx(36,7):
Variable 'FIELDS' implicitly has type 'any[]' in some locations where its type cannot be determined.  TS7034

    34 | };
    35 | 
  > 36 | const FIELDS = [];
       |       ^
    37 | 
    38 | const isNewEntity = (entityId: string) => {
    39 |   return entityId === NEW_SUBPATH;


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cubafront@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cubafront@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\iskandarov\AppData\Roaming\npm-cache\_logs\2021-02-25T15_07_14_104Z-debug.log

> Task :app-front:buildFrontend FAILED

Execution failed for task ':app-front:buildFrontend'.
> Process 'command 'npm.cmd'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.