SAP / generator-easy-ui5

Meta-generator various project types within the UI5 Universe
https://blogs.sap.com/2021/04/09/easy-ui5-3.0-from-community-contributions-to-community-plugins/
Apache License 2.0
230 stars 72 forks source link

env.lookup(...).filter is not a function #132

Closed signix closed 7 months ago

signix commented 7 months ago

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings yo easy-ui5 --plugins

 _-----_
|       |    ╭──────────────────────────╮
|--(o)--|    │  Welcome to the easy-ui5 │

---------´ │ 3.6.3 generator! │ ( _´U_ ) ╰──────────────────────────╯ /A\ / | ~ | __'._.' ´ |° ´ Y

Node.js: v18.18.2 yeoman-environment: 3.19.3 generator-easy-ui5: 3.6.3 home: C:\Users\simon.georges\AppData\Roaming\npm\node_modules\generator-easy-ui5 pluginsHome: C:\Users\simon.georges.npm_generator-easy-ui5\plugin-generators

Available generators: ✖ An error occured while running easy-ui5:app#prompting Error easy-ui5 --plugins

Cannot read properties of null (reading '1')

OS/version:

Windows 11

Browser/version (+device/version):

Steps to reproduce the problem:

  1. Step 1 Install NodeJS (tested with version 20 and 18)
  2. Step 2 npm install -g yo generator-easy-ui5
  3. Step 3 execute yo easy-ui5 project

What is the expected result?

project generation

What happens instead?

✖ An error occured while running easy-ui5:app#prompting Error easy-ui5 project

env.lookup(...).filter is not a function

Any other information? (attach screenshot if possible)

I was trying to use the ts-app-fcl module but have the error even with only project.

image

cpa-gecko commented 7 months ago

Looks like lookup is a promise now, works if you await the return like this within generators index.js line 640:

let subGenerators = (await env.lookup({ localOnly: true, packagePaths: generatorPath })).filter((sub) => {

signix commented 7 months ago

Make sense. Do you want to do the fix or should I add a pull request ? How can I test it ? Thank you

cpa-gecko commented 7 months ago

you can modify the index.js in your node_modules folder. that got it working again for me

fleischr commented 7 months ago

will be glad to help test too! got the same issue

vobu commented 7 months ago

Make sense. Do you want to do the fix or should I add a pull request ? How can I test it ? Thank you

bring in that PR - I‘ll try adding a unit test for it. Then I‘ll assign to @cpa-gecko and @fleischr for review!

cpa-gecko commented 7 months ago

created the PR: https://github.com/cpa-gecko/generator-easy-ui5/commit/c6b6050da63f665668a7e79376ba59992d5676ae

nadezhdayovkova commented 7 months ago

Hello, even with the proposal fix, I still get the error. ✖ An error occured while running easy-ui5:app#prompting Error easy-ui5 project

env.lookup(...).filter is not a function

ABVN-Chuong commented 7 months ago

image I got the same problems How can I fix that ? Thanks

DominikZ2001 commented 7 months ago

Hey, same problem here. Is there a quick solution for this issue? Thanks Edit: changing the index.js fixed it for me.

petermuessig commented 7 months ago

https://www.npmjs.com/package/generator-easy-ui5

Version 3.7.0 is released and available!