ui5-community / generator-ui5-project

Generator for UI5-based web-apps which use the official UI5 tooling and support multiple deployment targets such as the SAP Business Technology Platform
Apache License 2.0
33 stars 25 forks source link

Error when creating "newwebapp" with "project" generator #68

Closed sonip1992 closed 1 day ago

sonip1992 commented 1 year ago

Easy-Ui5 version:

3.6.2

OS/version:

Windows 11 Enterprise 22H2

Browser/version (+device/version):

Not yet run on browser as project is not getting created

Steps to reproduce the problem:

Create newwebapp using the project generator

What is the expected result?:

project/newwebapp should be created successfully

What happens instead? Error in creating the newwebapp -

An error occured while running ui5-project:newwebapp#writing Error easy-ui5

Cannot read properties of undefined (reading 'includes')

Any other information? (attach screenshot if possible)

image

wridgeu commented 12 months ago

Hey there ๐Ÿ‘‹

Have you, by any chance, tried to directly call the sub generator "newwebapp" without previously selecting "app" and creating an app in the first place? If I remember correctly, "newwebapp" is not supposed to be called standalone. All the sub generators with "new" in their name are usually called from within an already existing project to ease creation of new development artifacts.

I think what you're looking for is simply running the "app" generator (which internally uses the newwebapp sub generator to generate the new app). :)

sonip1992 commented 12 months ago

Hi @wridgeu

You are absolutely right. I did directly call "newwebapp". However, If it is not supposed to be called standalone, then why there is a prompt for the project creation? Additionally, the error that comes up, clearly does not highlights the same.

Regards, Prashant

wridgeu commented 12 months ago

Hi @sonip1992

true that! There is some room for improvement. You'd have to first figure out if you're in an environment/context where a project already exist or not and based on that maybe adjust the options shown. Let's see what @petermuessig (not sure who to directly tag here, sorry ๐Ÿ˜…) thinks.

Anyway, were you able to resolve the initial issue?

petermuessig commented 11 months ago

Including also @nicoschoenteich into the loop. I have to follow-up with him first.

petermuessig commented 11 months ago

@sonip1992 - can you verify with the latest update whether it works? Just run the template again, it should update automatically and let us know what happens. What I've learned today is that the sub-templates require a proper configuration from the original execution which is stored in the ยด.yo-rc.json` and in case of it is missing a configuration due to a newer version of the template the sub-templates may fail.

@nicoschoenteich this is an architectural issue of the project generator template as it is not prepared for such cases. For a re-design of the project template one should be aware to ensure that the plugin works properly even if parameters are missing an may question them again. Maybe also a proper version check should be introduced...

sonip1992 commented 11 months ago

@petermuessig thanks for suggesting this. However, i now get a new error:

image

nicoschoenteich commented 1 day ago

With the new version of the generator (PR https://github.com/ui5-community/generator-ui5-project/pull/75) this issue is fixed. You can now create new uimodules inside an existing project. The project overalls follows a monorepo approach.