framework7-cli icon indicating copy to clipboard operation
framework7-cli copied to clipboard

Latest update breaks generate-assets...

Open tatembuva opened this issue 5 years ago • 12 comments

(node:69348) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'platforms' of undefined at generateAssets (/usr/local/lib/node_modules/framework7-cli/generate-assets/index.js:39:19) at Command.program.command.option.option.description.action (/usr/local/lib/node_modules/framework7-cli/index.js:90:13) at process._tickCallback (internal/process/next_tick.js:68:7) (node:69348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:69348) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Why do you force the update when running the cli...? Is there anyway of making that optional, like just alerting if an update is available, like npm...

tatembuva avatar May 03 '19 13:05 tatembuva

it seems like the problem is that it's expecting the platforms to be inside framework7 -> cordova in package.json . But after I changed my package.json I get another error which seems to be because generateAssets is called with an empty options object. ✖ Error generating assets Error: Input file is missing

patchlog avatar May 03 '19 16:05 patchlog

After changing package.json framework7 generate-assets --ui works

patchlog avatar May 03 '19 16:05 patchlog

add this to your package.json under framewok7:

"cordova": {
      "platforms": [
        "android"
      ],
      "folder": "cordova"
    }

also make sure the cwd property points to the correct path. the android icon name also changed to assets-src/cordova-android-icon.png

mtsunu avatar May 11 '19 12:05 mtsunu

I'm having the same issue, even with the proper package.json, when I click generate assets in the ui it just stops the server and /generate errors out.

bleecv avatar Jun 28 '19 19:06 bleecv

Same error as @bleecv here, any solution?

Adrian-GP avatar Aug 31 '19 16:08 Adrian-GP

Same problem as @bleecv and @Adrian-GP

andreescocard avatar Sep 17 '19 19:09 andreescocard

I find i way to make it run, in my package.json the cwd file was with the wrong path. After fixing it, i run the command again, give some DeprecationWarning than started to show a message with Generating assets (Please wait, it can take a while), and it stays like this for an hour! The process manager show that it is running, sometimes the node.js and java gives some spikes on CPU, but any file was modified in res folder.. So i believe that it's just not working.. i generated the assets manually

andreescocard avatar Sep 17 '19 20:09 andreescocard

Any solution?

caiotarifa avatar Mar 17 '20 02:03 caiotarifa

Any solution?

I generated my assets in another project, then pasted the folders in my main project I think, that's what I recall, but I didn't find a solution back then, that's for sure.

Adrian-GP avatar Mar 17 '20 02:03 Adrian-GP

Check the path for cwd in framework7.json. I changed the project location manually but forgot to update path in this file.

Djekswon avatar Feb 18 '21 11:02 Djekswon

@Djekswon got it right (nice timing by the way), I had the same issue after I've moved my project folder.

fodi avatar Feb 18 '21 14:02 fodi

Check the path for cwd in framework7.json. I changed the project location manually but forgot to update path in this file.

Yeah, just make cwd relative like "./"

MiguelQueiroz avatar Oct 17 '23 22:10 MiguelQueiroz