Can't build for ios

Hey all -

Finally ready to (try to) build for iOS but I’m getting an error I can’t seem to track down. The error log says Meteor is basically looking for a file in a .meteor directory housed already within a .meteor directory. Anyone else experience this and know how to fix it? App is on meteor v2.2, fyi.

I once saved a copy of node_modules in my root folder, which got me all kinds of weird error messages.
I don’t think that’s your problem here, but something similar just might have happened, maybe you’ve saved part of your app somewhere close to the app you’re building.

Interesting. I do have my node_modules folder in my root. Where do you store yours now that you learned having it in the root was causing issues?

Sorry to have misled you, I meant home folder.
Of course node_modules should be in the root of your application.

What does your cordova-build folder look like?
(Here’s mine)

Schermata 2021-06-16 alle 07.26.04

Ah. Here’s how mine looks. Basically identical to yours. I should add: I’ve searched high and low on the topic of my question, and have discovered countless articles where others find this issue of events.js throwing an "unhandled ‘error’ event. The reasons are hugely diverse and thus don’t point to something straightforward to troubleshoot.

Things I’ve done:

  • Blown away my cordova-build folder (many times)
  • Blow away my .meteor/local folder
  • Blow away my node_modules folder as well as package-lock.json
  • Cleared meteor and node_modules cache

Screen Shot 2021-06-16 at 8.38.32 AM

One thing I noticed is that the config.xml has a content src attribute pointing to a localhost + port that doesn’t exist. I.e.: <content src="http://localhost:12728/"/> It doesn’t appear that affects anything but it’s still confusing why/how that arises.

Lastly, I’ll share the way I’m trying to develop for iOS. I’m connecting my device and running: meteor run ios-device --mobile-server 10.0.0.21. As of this morning, I still continue to get the same error in my first screenshot above. In 5.5 years of working with Meteor, the experience has been fantastic. This, however, is maddening.

Sharing some additional info: despite working with Meteor for so many years, I hadn’t heard of the HOME (or $HOME, which I see referenced a lot) directory. Looking at this thread (https://forums.meteor.com/t/problem-with-meteor-run-ios/738/5, they talk about deleting various folders from within the $HOME directory, including a .meteor folder.

What stands out in that thread is that they have a .meteor directory in the $HOME folder. My error (first screenshot above) indicates that it can’t find a file/directory, and the path indicates it’s looking for contents of a /.meteor folder within .meteor/cordova-build/. So something must be going wrong where that internal directory fails to be built.

In case anyone else has this happen, I finally found a fix. I searched the entire internet, deleted everything and rebuilt, changes jobs, got a liver transplant, bought a new house……………yet ultimately it was a package i added that scans the app for security.

east5th:package-scan

Deleting that package fixed this long mess of an issue.