pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Generate the iOS package with the latest PWABuilder CLI fails. #350

Closed MEPTRuiBras closed 4 years ago

MEPTRuiBras commented 4 years ago

Generate the iOS package with the latest PWABuilder CLI fails with "Invalid or unexpected token" when using the latest Apache Cordova CLI v9 (or v8.1.2) on Node.js v14.2.

The Android package was successfully created, no questions about the W3C manifest.

The data that I can share with you (client IP restrictions) are the following:

MS Windows 10 Pro v1909 b18363.836 (x64,enUS) Node.js v14.2.0 PWABuilder CLI v2.0.3-rc.1 (or v2.0.3-rc.0 or v2.0.1-rc.2) Apache Cordova CLI (cordova) v9.0.0 (or v8.1.2) Apache Cordova Lib (cordova-lib) v9.0.1 (or v8.1.1) Apache Cordova iOS (cordova-iOS) v4.5.5

[warn ] pwabuilder  : Forcing to format w3c...
[info ] pwabuilder  : Reading manifest file (...)\manifest.json...
[info ] pwabuilder  : Found a w3c manifest...
[debug] pwabuilder  : Manifest contents:
                      {
                          "name": "(...)",
                          "short_name": "(...)",
                          "mjs_description": "(...).",
                          "icons": [
                              {
                                  "src": "(...)",
                                  "sizes": "36x36",
                                  "type": "image/png"
                              },
                              (...)
                          ],
                          "start_url": "(...)",
                          "scope": "/",
                          "mjs_extended_scope": [
                              (...)
                          ],
                          "mjs_offline_feature": false,
                          "display": "standalone",
                          "orientation": "portrait"
                      }
[debug] pwabuilder  : Loading platform module: pwabuilder-cordova
[debug] pwabuilder  : Loading platform module: pwabuilder-android
[debug] pwabuilder  : Creating the 'Cordova Platform' app...
[debug] pwabuilder  : Creating the 'Android Platform' app...
[info ] android     : Generating the Android Platform app...
[debug] android     : Creating the Android Platform app folder...
[info ] cordova     : Generating the iOS Platform app(s)...
[info ] cordova     : Creating the Cordova Platform project...
[debug] android     : Downloading the android icons...
[debug] pwabuilder  : Downloading icon file from (...)
(...)
[debug] android     : No default icons were found to copy for the 'android' platform.
[info ] android     : Copying documentation from '(...)\pwabuilder\node_modules\pwabuilder-android\lib\docs' to '(...)\android'...
[info ] android     : Writing the generation information for the 'Android Platform' platform to '(...)\android\generationInfo.json'...
[debug] android     : Copying project assets...
[debug] pwabuilder  : Copied file (...)
(...)
[debug] pwabuilder  : Created target directory at '(...)\android\source\gradle\wrapper'.
[debug] pwabuilder  : Copied file (...)
[debug] pwabuilder  : Created target directory at (...)
(...)
[debug] pwabuilder  : Copied file (...)
(...)
[debug] android     : Copying downloaded images...
[debug] android     : Updating app's name element...
[debug] android     : Updating colorPrimary element...
[debug] android     : Copying the Android Platform manifest to the app folder...
[info ] pwabuilder  : The Android Platform app was created successfully!
[debug] pid:7772    : Launching external process: '(...)\npm\node_modules\pwabuilder\node_modules\.bin\cordova.cmd create cordova (...) (...)'
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
[debug] pid:7772    : (Use `node --trace-warnings ...` to show where the warning was created)
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
[debug] pid:7772    : (node:4788) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
[debug] pid:7772    : Creating a new cordova project.
[info ] cordova     : Copying the Cordova Platform manifest to the app folder...
[info ] cordova     : Adding the following plugins to the Cordova project: cordova-plugin-hostedwebapp@0.3.x cordova-plugin-whitelist...
[debug] pid:8700    : Launching external process: '(...)\npm\node_modules\pwabuilder\node_modules\.bin\cordova.cmd plugin add cordova-plugin-hostedwebapp@0.3.x cordova-plugin-whitelist'
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
[debug] pid:8700    : (Use `node --trace-warnings ...` to show where the warning was created)
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
[debug] pid:8700    : (node:5320) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
[debug] pid:8700    : Adding cordova-plugin-hostedwebapp to package.json
[debug] pid:8700    : Saved plugin info for "cordova-plugin-hostedwebapp" to config.xml
[debug] pid:8700    : Adding cordova-plugin-whitelist to package.json
[debug] pid:8700    : Saved plugin info for "cordova-plugin-whitelist" to config.xml
[info ] cordova     : Adding the following Cordova platforms: ios...
[debug] pid:20476   : Launching external process: '(...)\npm\node_modules\pwabuilder\node_modules\.bin\cordova.cmd platform add ios'
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
[debug] pid:20476   : (Use `node --trace-warnings ...` to show where the warning was created)
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
[debug] pid:20476   : Using cordova-fetch for cordova-ios@~4.5.4
[debug] pid:20476   : (node:12088) Warning: Accessing non-existent property 'ios' of module exports inside circular dependency
[debug] pid:20476   : Adding ios project...
[debug] pid:20476   : Creating Cordova project for the iOS platform:
[debug] pid:20476   :   Path: platforms\ios
[debug] pid:20476   :   Package: (...)
[debug] pid:20476   :   Name: (...)
[debug] pid:20476   : iOS project created with cordova-ios@4.5.5
[debug] pid:20476   : Installing "cordova-plugin-hostedwebapp" for ios
[debug] pid:20476   : Plugin doesn't support this project's cordova-ios version. cordova-ios: 4.5.5, failed version requirement: <=4.1.9
[debug] pid:20476   : Skipping 'cordova-plugin-hostedwebapp' for ios
[debug] pid:20476   : Installing "cordova-plugin-whitelist" for ios
[debug] pid:20476   : Invalid or unexpected token
[error] pwabuilder  : Failed to create the Cordova Platform app.
                          at (...)\npm\node_modules\pwabuilder\node_modules\pwabuilder-lib\lib\projectBuilder.js:145:31
                          at _rejected ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:864:24)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:890:30
                          at Promise.when ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:1142:31)
                          at Promise.promise.promiseDispatch ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:808:41)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:624:44
                          at runSingle ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:137:13)
                          at flush ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:125:13)
                          at processTicksAndRejections (internal/process/task_queues.js:79:11)
                      Failed to add the Cordova platforms: ios.
                          at (...)\npm\node_modules\pwabuilder\node_modules\pwabuilder-cordova\lib\platform.js:76:23
                          at _rejected ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:864:24)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:890:30
                          at Promise.when ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:1142:31)
                          at Promise.promise.promiseDispatch ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:808:41)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:624:44
                          at runSingle ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:137:13)
                          at flush ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:125:13)
                          at processTicksAndRejections (internal/process/task_queues.js:79:11)
                      External process [process ID: 20476] completed with errors
. (node:12088) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
                      (Use `node --trace-warnings ...` to show where the warning was created)
                      (node:12088) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
                      (node:12088) Warning: Accessing non-existent property 'ios' of module exports inside circular dependency
                      Invalid or unexpected token
                          at ChildProcess.<anonymous> ((...)\npm\node_modules\pwabuilder\node_modules\pwabuilder-lib\lib\processTools.js:109:17)
                          at ChildProcess.emit (events.js:315:20)
                          at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
[error] pwabuilder  : One or more platforms could not be generated successfully.
                          at (...)\npm\node_modules\pwabuilder\node_modules\pwabuilder-lib\lib\projectBuilder.js:29:23                          
                          at _fulfilled ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:854:54)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:883:30
                          at Promise.promise.promiseDispatch ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:816:13)
                          at (...)\npm\node_modules\pwabuilder\node_modules\q\q.js:624:44
                          at runSingle ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:137:13)
                          at flush ((...)\npm\node_modules\pwabuilder\node_modules\q\q.js:125:13)
                          at processTicksAndRejections (internal/process/task_queues.js:79:11)
ghost commented 4 years ago

Hello MEPTRuiBras, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will investigate the issue and help solve it ASAP. Other community members may also look into the issue and provide feedback 🙌

JudahGabriel commented 4 years ago

We don't currently support iOS project types; this functionality has been deprecated while we talk with Apple their new policy which seems to prohibit PWAs in the iOS App Store.

We're discussing this with Apple. If they clarify they will support PWAs in the iOS app store, then we'll have a look at this issue.