generator-ui5-project icon indicating copy to clipboard operation
generator-ui5-project copied to clipboard

Error when creating "newwebapp" with "project" generator

Open sonip1992 opened this issue 1 year ago • 6 comments

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

sonip1992 avatar Jul 06 '23 11:07 sonip1992

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). :)

wridgeu avatar Jul 08 '23 15:07 wridgeu

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

sonip1992 avatar Jul 11 '23 05:07 sonip1992

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?

wridgeu avatar Jul 11 '23 05:07 wridgeu

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

petermuessig avatar Jul 15 '23 07:07 petermuessig

@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...

petermuessig avatar Jul 15 '23 09:07 petermuessig

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

image

sonip1992 avatar Jul 20 '23 04:07 sonip1992

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.

nicoschoenteich avatar Jul 03 '24 15:07 nicoschoenteich