wojtkowiak / meteor-desktop

Build a Meteor's desktop client with hot code push.
MIT License
448 stars 84 forks source link

Unable to run Meteor 1.9 with meteor-desktop #264

Open wreiske opened 4 years ago

wreiske commented 4 years ago

I am thrilled to see some progress with meteor-desktop!! Decided to finally try it again in my meteor project, but it seems to fail to start.

vpn0-user6:project username$ meteor npm install --save-dev meteor-desktop
vpn0-user6:project username$ meteor run ios --port 5000 --mobile-server=http://localhost --verbose --settings settings.json

The app starts, and then errors out.

=> Started your app.

=> App running at: http://localhost:5000/
W20200125-21:59:01.584(-5)? (STDERR) WARNING: Push APN is in development mode
TypeError: Cannot read property 'toLowerCase' of undefined
    at /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-build-targets:54:45
    at Array.forEach (<anonymous>)
    at /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-build-targets:52:44
    at Array.reduce (<anonymous>)
    at /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-build-targets:50:57
    at Array.reduce (<anonymous>)
    at /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-build-targets:45:28
    at _fulfilled (/Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:854:54)
    at /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:816:13)
=> Errors executing Cordova commands:

   While running Cordova app for platform iOS with options
   --buildConfig,/Users/username/prj/project/.meteor/local/cordova-build/build.json,--emulator:
   Error: Command failed: /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/run --buildConfig
   /Users/username/prj/project/.meteor/local/cordova-build/build.json --emulator

   at ChildProcess.exitCallback
   (/Users/username/.meteor/packages/meteor-tool/.1.9.0.1lpg62k.6s1p++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/utils/tools/utils/processes.ts:174:23)
   at ChildProcess.emit (events.js:210:5)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

/Users/username/.meteor/packages/coffeescript/.1.0.17.12bvfse.4o3a++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
      throw error;
      ^
ExitWithCode { code: 1 }

Any ideas?

wreiske commented 4 years ago

Looks like listEmulatorBuildTargets() needs to be modified in .meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-build-targets

Before

 availableDevicesInCategory.forEach(function (device) {
                    if (device.name === deviceType.name.replace(/\-inch/g, ' inch') && 
                        device.availability.toLowerCase().indexOf('unavailable') < 0) {
                            availAcc.push(device);
                        }
                });

After

 availableDevicesInCategory.forEach(function (device) {
                        if (device.name === deviceType.name.replace(/\-inch/g, ' inch') && device.isAvailable) {
                            availAcc.push(device);
                        }
                    });

After that, the following error occurs:

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to undefined simulator
** RUN SUCCEEDED **
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
=> Errors executing Cordova commands:

   While running Cordova app for platform iOS with options
   --buildConfig,/Users/username/prj/project/.meteor/local/cordova-build/build.json,--emulator:
   Error: Command failed: /Users/username/prj/project/.meteor/local/cordova-build/platforms/ios/cordova/run --buildConfig
   /Users/username/prj/project/.meteor/local/cordova-build/build.json --emulator

   at ChildProcess.exitCallback
   (/Users/username/.meteor/packages/meteor-tool/.1.9.0.1lpg62k.6s1p++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/utils/tools/utils/processes.ts:174:23)
   at ChildProcess.emit (events.js:210:5)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

/Users/username/.meteor/packages/coffeescript/.1.0.17.12bvfse.4o3a++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
      throw error;
      ^
ExitWithCode { code: 1 }

Running with ios-device instead of ios runs...

For some reason, it died and now it won't start

=> Started MongoDB.
[meteor-desktop] calculated .desktop hash version is d12bcf5349c54ffc63de845c3d91fe8b76cf29b1_dev
/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:217
    if (this instanceof WriteStream)
             ^

RangeError: Maximum call stack size exceeded
    at Function.[Symbol.hasInstance] (<anonymous>)
    at WriteStream (/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:217:14)
    at WriteStream (/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:218:29)
    at WriteStream (/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:218:29)

... spammed a million times and then finished with this

    at WriteStream (/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:218:29)
    at new WriteStream (/Users/username/.meteor/packages/omega_meteor-desktop-bundler/.2.2.5.1wrzb89.06n2i++os+web.browser+web.browser.legacy+web.cordova/plugin.meteor-desktop-bundler.os/npm/node_modules/meteor/meteor-desktop-bundler/node_modules/graceful-fs/graceful-fs.js:218:29)
    at Object.createWriteStream (/Users/username/.meteor/packages/meteor-tool/.1.9.0.1lpg62k.6s1p++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/graceful-fs/graceful-fs.js:306:12)
    at Object.module.exports.writeFilesystem (/Users/username/prj/project/node_modules/asar/lib/disk.js:60:18)
    at /Users/username/prj/project/node_modules/asar/lib/asar.js:150:19
    at /Users/username/prj/project/node_modules/mkdirp/index.js:48:26
    at callback (/Users/username/.meteor/packages/meteor-tool/.1.9.0.1lpg62k.6s1p++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/graceful-fs/polyfills.js:295:20)
    at callback (/Users/username/.meteor/packages/meteor-tool/.1.9.0.1lpg62k.6s1p++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:159:5)