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
235 stars 72 forks source link

error while creating ui5 project #145

Closed 333sachin closed 2 months ago

333sachin commented 3 months ago

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings Node.js: v20.15.0 yeoman-environment: 3.19.3 generator-easy-ui5: 3.8.1 home: C:\Users\sachi\AppData\Roaming\npm\node_modules\generator-easy-ui5 pluginsHome: C:\Users\sachi.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, 64 bit

Browser/version (+device/version):

Edge, Version 126.0.2592.87 (Official build) (64-bit)

Steps to reproduce the problem:

  1. Step 1 create project with easy-ui generator
  2. Step 2 enter the following parameters Select your generator? project

? What do you want to do? project [project]

? Which namespace do you want to use? com.saturn ? How do you want to name this project? saturn ? How do you want to name the first uimodule within your project? customers ? Do you want to enable the SAP Fiori elements flexible programming model? Yes ? Do you want to use the awesomeness of TypeScript? Yes ? Do you want the module to be visible in the SAP Fiori tools? No ? On which platform would you like to host the application? Application Router ? Where should your UI5 libs be served from? Local resources (SAPUI5) ? Would you like to create a new directory for the project? No ? Would you like to initialize a local git repository for the project? No

  1. Step 3 ✨ creating new project com.saturn.saturn force .yo-rc.json create package.json create README.md ✨ creating new uimodule customers create customers.gitignore create customers\package.json create customers\ui5-local.yaml create customers\ui5.yaml create customers\webapp\index.html create customers\webapp\manifest.json create customers\webapp\i18n\i18n.properties create customers\webapp\test\locate-reuse-libs.js create customers.eslintrc create customers\tsconfig.json create customers\webapp\Component.ts create mta.yaml create approuter\package.json create approuter\xs-app.json ? What is the URL of your main service? http://localhost:4004/odata/v4/catalog/Books × An error occured while running ui5-project:fpmpage#prompting

What is the expected result?

project folder should be created

What happens instead?

× An error occured while running ui5-project:fpmpage#prompting Error easy-ui5

Request failed with status code 400 TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('ERR_BAD_REQUEST') at process.set [as exitCode] (node:internal/bootstrap/node:123:9) at process.exit (node:internal/process/per_thread:180:24) at onError (C:\Users\sachi\AppData\Roaming\npm\node_modules\yo\lib\cli.js:117:11) at C:\Users\sachi\AppData\Roaming\npm\node_modules\yo\lib\cli.js:168:54 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async init (C:\Users\sachi\AppData\Roaming\npm\node_modules\yo\lib\cli.js:168:5) at async pre (C:\Users\sachi\AppData\Roaming\npm\node_modules\yo\lib\cli.js:83:3) at async C:\Users\sachi\AppData\Roaming\npm\node_modules\yo\lib\cli.js:193:3 AxiosError: Request failed with status code 400 at settle (C:\Users\sachi.npm_generator-easy-ui5\plugin-generators\generator-ui5-project\node_modules\axios\dist\node\axios.cjs:1966:12) at IncomingMessage.handleStreamEnd (C:\Users\sachi.npm_generator-easy-ui5\plugin-generators\generator-ui5-project\node_modules\axios\dist\node\axios.cjs:3065:11) at IncomingMessage.emit (node:events:531:35) at IncomingMessage.emit (node:domain:488:12) at endReadableNT (node:internal/streams/readable:1696:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) at ODataService.request (C:\Users\sachi.npm_generator-easy-ui5\plugin-generators\generator-ui5-project\node_modules\axios\dist\node\axios.cjs:3876:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ODataService.get (C:\Users\sachi.npm_generator-easy-ui5\plugin-generators\generator-ui5-project\node_modules\@sap-ux\axios-extension\dist\base\odata-service.js:95:26) at async ODataService.metadata (C:\Users\sachi.npm_generator-easy-ui5\plugin-generators\generator-ui5-project\node_modules\@sap-ux\axios-extension\dist\base\odata-service.js:75:30) at async default.prompts (file:///C:/Users/sachi/.npm/_generator-easy-ui5/plugin-generators/generator-ui5-project/generators/fpmpage/prompts.js:33:36) at async default.lookForParentUI5ProjectAndPrompt (file:///C:/Users/sachi/.npm/_generator-easy-ui5/plugin-generators/generator-ui5-project/generators/helpers.js:33:2) at async default.prompting (file:///C:/Users/sachi/.npm/_generator-easy-ui5/plugin-generators/generator-ui5-project/generators/fpmpage/index.js:17:3) at async default.executeTask (file:///C:/Users/sachi/.npm/_generator-easy-ui5/plugin-generators/generator-ui5-project/node_modules/yeoman-generator/dist/actions/lifecycle.js:265:13) at async runLoop.add.once (file:///C:/Users/sachi/AppData/Roaming/npm/node_modules/yo/node_modules/yeoman-environment/dist/environment-base.js:395:17)

Any other information? (attach screenshot if possible)

nicoschoenteich commented 3 months ago

Hi @333sachin, is the OData service at http://localhost:4004/odata/v4/catalog running while you are running the generator?

nicoschoenteich commented 3 months ago

Also, can you try omitting Books in the service URL, so only use http://localhost:4004/odata/v4/catalog when prompted. The generator asks for the entity in the next prompt.

333sachin commented 2 months ago

yes, the service was running. Tried with http://localhost:4004/odata/v4/catalog, now got this error image

? Select your generator? project

? What do you want to do? project [project]

? Which namespace do you want to use? com.saturn ? How do you want to name this project? saturn ? How do you want to name the first uimodule within your project? books ? Do you want to enable the SAP Fiori elements flexible programming model? Yes ? Do you want to use the awesomeness of TypeScript? Yes ? Do you want the module to be visible in the SAP Fiori tools? Yes ? On which platform would you like to host the application? Application Router ? Where should your UI5 libs be served from? Local resources (SAPUI5) ? Would you like to create a new directory for the project? Yes ? Would you like to initialize a local git repository for the project? No ✨ creating new project com.saturn.saturn force com.saturn.saturn.yo-rc.json create com.saturn.saturn\package.json create com.saturn.saturn\README.md ✨ creating new uimodule books create com.saturn.saturn\books.gitignore create com.saturn.saturn\books\package.json create com.saturn.saturn\books\ui5-local.yaml create com.saturn.saturn\books\ui5.yaml create com.saturn.saturn\books\webapp\index.html create com.saturn.saturn\books\webapp\manifest.json create com.saturn.saturn\books\webapp\i18n\i18n.properties create com.saturn.saturn\books\webapp\test\locate-reuse-libs.js create com.saturn.saturn\books.eslintrc create com.saturn.saturn\books\tsconfig.json create com.saturn.saturn\books\webapp\Component.ts create com.saturn.saturn\mta.yaml create com.saturn.saturn\approuter\package.json create com.saturn.saturn\approuter\xs-app.json ? What is the URL of your main service? http://localhost:4004/odata/v4/catalog ? What type of page do you want to add? Custom Page ? What entity should be used for the new page? Books ? How do you want to name your custom page view? main ✨ adding a custom page to books conflict com.saturn.saturn\books\package.json ? Overwrite com.saturn.saturn\books\package.json? overwrite force com.saturn.saturn\books\package.json create com.saturn.saturn\books\webapp\ext\sap.fe.d.ts create com.saturn.saturn\books\ui5-mock.yaml create com.saturn.saturn\books\webapp\localService\metadata.xml create com.saturn.saturn\books\webapp\annotations\annotation.xml create com.saturn.saturn\books\webapp\ext\main\main.view.xml create com.saturn.saturn\books\webapp\ext\main\main.controller.ts conflict com.saturn.saturn\books\ui5-local.yaml ? Overwrite com.saturn.saturn\books\ui5-local.yaml? overwrite force com.saturn.saturn\books\ui5-local.yaml conflict com.saturn.saturn\books\ui5.yaml ? Overwrite com.saturn.saturn\books\ui5.yaml? overwrite force com.saturn.saturn\books\ui5.yaml conflict com.saturn.saturn\books\webapp\manifest.json ? Overwrite com.saturn.saturn\books\webapp\manifest.json? overwrite force com.saturn.saturn\books\webapp\manifest.json conflict com.saturn.saturn\books\webapp\i18n\i18n.properties ? Overwrite com.saturn.saturn\books\webapp\i18n\i18n.properties? overwrite force com.saturn.saturn\books\webapp\i18n\i18n.properties You can start your new uimodule by running cd com.saturn.saturn && npm run start:books. force com.saturn.saturn.yo-rc.json

books@0.0.1 npx create-wdi5 --configPath ./webapp/test/e2e/ --baseUrl http://localhost:8080/index.html --ts

≡> copying tsconfig.json into "./webapp/test/e2e/"... ≡> copying wdio.conf.ts into "./webapp/test/e2e/\" 👍 done! ≡> copying sample test files into "./webapp/test/e2e/"... 👍 done! ≡> installing wdio + wdi5 and adding them as dev dependencies... npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead npm warn deprecated npmlog@4.1.2: This package is no longer supported. npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported. npm warn deprecated @ui5/logger@2.0.1: UI5 Tooling version 2 is out of maintenance. Migrate your project to the latest version: https://sap.github.io/ui5-tooling/stable/ npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm warn deprecated gauge@2.7.4: This package is no longer supported.

added 1638 packages, and audited 1640 packages in 53s

217 packages are looking for funding run npm fund for details

10 high severity vulnerabilities

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. 👍 done!

≡> if your're using eslint, please add the "test"'s tsconfig.json to its' project setting: "project": ["./tsconfig.json", "./webapp/test/e2e/tsconfig.json"]

≡> adding wdi5 start command to package.json... 👍 done! Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11) at defaultLoad (node:internal/modules/esm/load:130:3) at ModuleLoader.load (node:internal/modules/esm/loader:396:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56) at new ModuleJob (node:internal/modules/esm/module_job:67:26) at #createModuleJob (node:internal/modules/esm/loader:290:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:247:34) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:17) at async ModuleLoader.import (node:internal/modules/esm/loader:315:23) Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11) at defaultLoad (node:internal/modules/esm/load:130:3) at ModuleLoader.load (node:internal/modules/esm/loader:396:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56) at new ModuleJob (node:internal/modules/esm/module_job:67:26) at #createModuleJob (node:internal/modules/esm/loader:290:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:247:34) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:17) at async ModuleLoader.import (node:internal/modules/esm/loader:315:23) Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11) at defaultLoad (node:internal/modules/esm/load:130:3) at ModuleLoader.load (node:internal/modules/esm/loader:396:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56) at new ModuleJob (node:internal/modules/esm/module_job:67:26) at #createModuleJob (node:internal/modules/esm/loader:290:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:247:34) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:17) at async ModuleLoader.import (node:internal/modules/esm/loader:315:23) Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11) at defaultLoad (node:internal/modules/esm/load:130:3) at ModuleLoader.load (node:internal/modules/esm/loader:396:13) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56) at new ModuleJob (node:internal/modules/esm/module_job:67:26) at #createModuleJob (node:internal/modules/esm/loader:290:17) at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:247:34) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:17) at async ModuleLoader.import (node:internal/modules/esm/loader:315:23)

nicoschoenteich commented 2 months ago

Ok, but the error now happens pretty late in the process. Is the project being generated?

333sachin commented 2 months ago

yes, the folder gets created, but it doesnt run. package.json is missing version. After adding version, get this error on ui5 serve

⚠️ Process Failed With Error

Error Message: Failed to create a UI5 project from module com.saturn.saturn at C:\projects\tests\com.saturn.saturn. Make sure the path is correct and a project configuration is present or supplied.

nicoschoenteich commented 2 months ago

Looks like this is a problem that needs further investigation. Also seems like it is Windows specific. Can you share the (non-functional) generated project, so I can reserve engineer what might have gone wrong?

333sachin commented 2 months ago

Looks like this is a problem that needs further investigation. Also seems like it is Windows specific. Can you share the (non-functional) generated project, so I can reserve engineer what might have gone wrong?

sure, uploaded here: https://github.com/333sachin/com.saturn.saturn removed the version I added before upload to github.

nicoschoenteich commented 2 months ago

I checked out your repo and it looks good to me. Also, the project runs on my machine. I'll still provide a PR for what I think might be the issue throwing the error with the "unsupported url scheme".