Nicolas Chusseau
Nicolas Chusseau

Reputation: 81

RedwoodJS, Error generating sdl from the given command : Identifier has already been declared

In my RedwoodJS app, I want to create a form with the data from my editorialCalendars table.
To do this, I used the command yarn rw g cell editorialCalendars. This command worked. After that, I ran the command yarn rw g sdl editorialCalendars but I get the following error :

To continue, the generator requires a unique plural form: ... editorialCalendarses
← Reverted because: C:\Users\me\RedwoodJSApp\api\src\services\editorialCalendarses\editorialCalendarses.ts: Identifier
'editorialCalendars' has already been declared. (12:13)

10 | }
11 |
> 12 | export const editorialCalendars: QueryResolvers['editorialCalendars'] = ({
14 | }) => {
15 |   return db.editorialCalendars.findUnique({
◼ Generating types ...
C:\Users\me\RedwoodJSApp\veep-app\api\src\services\editorialCalendarses\editorialCalendarses.ts: Identifier 'editorialCalendars' has already been declared. (12:13)

  10 | }
  11 |
> 12 | export const editorialCalendars: QueryResolvers['editorialCalendars'] = ({
     |              ^
  13 |   id,
  14 | }) => {
  15 |   return db.editorialCalendars.findUnique({

When I look at my services folder I don't have editorialCalendarses/editorialCalendarses.ts as you can see on this picture :
image files structure

This is my model in my .prisma file :

model editorialCalendars {
  id                  Int          @id @default(autoincrement())
  createdAt           DateTime     @default(now())
  updatedAt           DateTime     @updatedAt @default(now())
  allSubjects         String
  active              Boolean
  team                teams?         @relation(fields: [teamId], references: [id])
  teamId              Int?
  subjects            subjects[]
}

Do you kown how to solve this problem ?

Upvotes: 0

Views: 31

Answers (0)

Related Questions