vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
MIT License
5.43k stars 958 forks source link

cli: Expected to find a symbol error when creating an API #2827

Open Draykee opened 2 months ago

Draykee commented 2 months ago

Describe the bug I get an error trying to create an API: image

To Reproduce Steps to reproduce the behavior:

  1. Create Plugin
  2. Create Entity (Translatable)
  3. Create Service (CRUD)
  4. Create API

I'm using vendure v2.2.2 (also CLI) and "@vendure-plus/advanced-search-plugin": "1.6.0"

Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

Additional context I have many other plugins and dependencies, but most of them align exactly with the ones used by vendure.

michaelbromley commented 2 months ago

Hi, I just repeated the steps on a clean v2.2.3 install and could not reproduce:

┌  ✨ Let's add a new feature to your Vendure project!
│
◇  Which feature would you like to add?
│  [Plugin] Create a new Vendure plugin
┌  Adding a new Vendure plugin!
│
◇  Project analyzed
│
◇  What is the name of the plugin?
│  test1
│
◇  Plugin location
│  C:\Development\temp\vendure-223\src\plugins\my-new-feature\test1
│
◇  Generated plugin scaffold
│
◇  Updated VendureConfig
│
◇  Add features to test1?
│  [Plugin: Entity] Add a new entity to a plugin
│
◇  What is the name of the custom entity?
│  Test
│
◇  Entity features (use ↑, ↓, space to select)
│  Custom fields, Translatable
│
◇  Entity created
│
◇  Add features to test1?
│  [Plugin: Service] Add a new service to a plugin
│
◇  What type of service would you like to add?
│  Service to perform CRUD operations on an entity
│
◇  Select an entity
│  Test
│
◇  TestService created
│
◇  Add features to test1?
│  [Plugin: API] Adds GraphQL API extensions to a plugin
│
◇  Which service contains the business logic for this API extension?
│  TestService: (CRUD service for Test)
│
◇  API extensions added
│
◆  Add features to test1?
│  ● [Finish] No, I'm done!
│  ○ [Plugin: Entity] Add a new entity to a plugin
│  ○ [Plugin: Service] Add a new service to a plugin
│  ○ [Plugin: API] Adds GraphQL API extensions to a plugin
│  ○ [Plugin: Job Queue] Defines an new job queue on a service
│  ○ [Plugin: UI] Set up Admin UI extensions
│  ○ [Project: Codegen] Set up GraphQL code generation

Are you performing all 4 steps in 1 single CLI session? And can you confirm which version you are on - you mentioned both v2.2.2 and v2.2.3 above.

Draykee commented 2 months ago

I'm using v2.2.3 and I did it in multiple session, to already add properties to the entity. I assume the CLI can't find the service:

image

Draykee commented 2 months ago

image

michaelbromley commented 2 months ago

Did you make any changes to the service before attempting to create the API?

If you are able to reproduce this from a clean install, please tell me the exact steps to reproduce. I'm lacking a bit of information currently.