Meteor: what does "there can be only one platform" mean? - meteor

I'm working through the Angular2-Meteor tutorial here. When I update the code for the app, I frequently encounter an error message, displayed in the browser console when I browse to the app running on localhost:
Error: There can be only one platform. Destroy the previous one to create a new one.
Sometimes the app seems to be running fine. Other times it is indeed not working. What does this error mean, and how should I fix it?

This happened to me when i was using the Atom editor. Atom compiles your typescript and outputs it in the same folder by default. Then Meteor sees both a *.ts and a *.js file and happily loads both of them. As a result 2 Angular platforms are created.
I don't know if you can change the *.js output folder with atom-typescript. I switched to VSCode for typescript development.

Related

Error: could not handle the request comes up when I deploy firebase from my local

On firebase console, it says my files are successfully deployed but in actual web page, it is just a black page with one senetence "Error: could not handle the request"
i did not started this project i am working on, and i have no idea what to do.
BTW, no errors are loged in firebase-debug.log
All things are clear, except for the web page.
As far as i know, this is based on Next.js, if you would care to know.
I opened up the file from the root folder, used "cd (myfilename)" command to go into the actual project, and then executed firebase deploy.
I googled thousands of times, and I doubted these:
node js version problem?
os problem? (i work on Window, and the first start was from Mac)
number one i solved. number two? i dont know.
Please help me out if you have any idea or can guess why this happens.

Unity deletes files itself from my asset folder on Mac OS

I've got a problem with Unity installed on Mac OS (Unity 2020.1.16f1 Personal and Mac OS Catalina 10.15.6)
It's look like Unity delete files by itself from my asset folder.
It occurs with both a Firebase (Firebase SDK 7.0.2) and PNG file.
The deletion seems to occur something like each hour (more or less)
However the problem don't happen with all my assets, for exemple with the Firebase SDK it seems that only the file FirebaseCppApp-7_0_2.bundle (and with my png file it happens only with a specific file).
Here's how I get the problem (exemple with Firebase SDK):
I import Firebase SDK I need into Unity (Import Package -> Custom Package and then choose the one I need)
Got this error: "DllNotFoundException: FirebaseCppApp-7_0_2"
Correct this error by going to Security And Confidentiality of my Mac and authorize Firebase to be open (when you download something from internet directly sometimes your Mac ask for this authorization because he don't recognize the developer)
Work perfectly for approximately 1 hour (I can make all changes I want, test my game with the game mode etc ...)
After 1 hour get the error of 2) again (on game mode)
I can fix the problem by reimport only one file from the SDK (FirebaseCppApp-7_0_2.bundle locate in Assets/Firebase/Plugins/x86_64/)
The first time I click play in Game Mode Unity crashes
Go to 3) step and continue
Is someone already get this error ? I've found multiple thread on internet talking about similar bugs (but not exactly the same) but nothing worked for me ...
I found and correct the problem. In fact the problem came from the iCloud which seems to not works correctly with Unity. For some obscur reason, the files which were deleted didn't sync with iCloud, and so when iCloud sent back the project the files were missing. You need to disable automatic sync with iCloud.
Some earlier versions of the Firebase SDK offered to add packages to the Unity Package Manager and would migrate files automatically. I would suggest using only unitypackage integration and trying to undo this migration in the process now. To see if this is the issue, do the following:
close Unity
open Packages/manifest.json and delete the entry for "ScopedRegistries" and remove any lines under "dependencies": { that start with "com.google. Note that Packages is a sibling of Assets (that is, it's next to rather than inside).
for safety, remove any Firebase packages under Assets. This include the folders:
Assets/ExternalDependencyManager, the (old) Assets/PlayServicesResolver, Assets/Firebase, Assets/Parse, Assets/Editor Default Resources/Firebase, Assets/Plugins/Android/Firebase, and Assets/Plugins/iOS/Firebase.
Download the latest Firebase Unity SDK (you can check the release notes here).
open Unity again and add each UnityPackage you need from the SDK. You can usually follow the errors in the console output if you've forgotten everything you're using.
A less likely issue you might be running into is MacOS's stricter behaviour with respect to gate keeper. There's a video here with a workaround, but since you mention the PNG files disappearing I expect that it's the External Dependency Manager.

How to troubleshoot .app bundle not working

I have been making an application using Javafx, and have finished the project turning it into an application. However, when I try to run the application it immediatley crashes with know error messages, nothing is printed to the console. As a note, the .jar file runs if clicked. This has led me to believe that the problem is with my file structure namely the fact that their are 2 binary files in the Java folder.
Here is my .app packages contents:
A fix to my problem would be nice, however beyond that how should one go about debugging this sort of thing, I can not find any log messages, can it be done?
Edit: Nothing is printed when in terminal I use open -a ApplicationName and the application crashes. And here is my info.plist.

Meteor android build version

I have a strange issue. I build my Meteor app and run it on android device using -
meteor run android-device --mobile-server=<my_aws_ip>:3000
When the app deploys immediately it connects to the server (and my javascripts etc works). After a few seconds, the page refreshs and none of the javascript callbacks work. Please help me debug this issue.
More information: If I change the client (and not the server), and deploy it, for the first few seconds, the changed client gets shown on the phone. After the first few seconds, the version which is present on the server is shown. So I think Cordova or Meteor is trying to fetch the client code from the server, which is breaking the app. Is there a way to prevent this behavior?
Even more data points -
My aws code does NOT have android and ios platforms installed. Because of this, I think the cordova plugins are not installed, causing a JS break somewhere.
Easiest fix I can think of is remove cordova autoupdate. This is being added by meteor-platform package. If I clone meteor-platform and comment out the cordova autoupdate, the app doesn't load.
Is there another way of removing autoupdate?
This sounds like you have a different version of your app deployed at the mobile-server address.
The local code is run in development mode. Your AWS one is likely in production mode (and may contain a syntax error).
When you run your app it sees the code is different and fetches the new/old (different) version with a hot code reload - hence the page refresh/flash.
To fix this, you need to find the syntax error in your code. It's best to view the ADB logger or run with meteor run --verbose android-device ....
This will provide a bit more information such as an Uncaught exception: cannot read .. of null error type error.
It's hard to say what the error is. The error prevents the rest of your code from executing. In production mode the entire project is one JS file. If there is an error of any kind half way along the file, the rest of the file will not execute.
Also, try loading <my_aws_ip>:3000 in your browser and watch for JS errors in the JS console.
You can also run it locally with --production to simulate a production build environment locally.
Enabling autoupdate but without a page refresh:
Reload._reload = function (options) {
console.log("Next load will load new version");
};

Meteor Environment - Blank and Everything Broken

I got to a point where Meteor seemed to just stop working, no HTML would load but the port was open, throwing basic console errors indicating that the most basic parts of the program weren't getting read.
After a lot of troubleshooting (clearing the database, restarting, logging out, using different ports), I just created a new Meteor project and copied and pasted my .html and .js files and the new project worked where the old project didn't.
So, question - how can I troubleshoot this in the future? Something was going on in the Meteor folder because the old and new files were exactly the same.
After a day, the error is happening all the time now and I can't create a single project. I tried uninstalling and reinstalling Meteor with no luck.
Also, the problem seems to be isolated to one port. I can open projects in other ports, but not in 3000.
Why is one port "breaking"? What can I do to fix this?
--Edit--
The HTML and CSS are loading, but in the default port 3000, the console reads
Uncaught ReferenceError: Package is not defined
It shows this code as the first error point:
/* Imports */
var Meteor = Package.meteor.Meteor;
Below is the Terminal:
--Edit--
So this is embarrassing, it seemed to be a cache problem. I cleared the cache, and I'm assuming it refreshed the .js files and now it works.
If anyone can answer why the errors were being thrown in the first place and how to fix besides creating an entirely new project, that would be hugely helpful!
please post your terminal so we have more clues to help you.
You definitely can run other ports, perhaps your port 3000 is used by another program.
Also, never run a meteor app as root.
Run meteor on a high port number. The default is 3000 when you don't give a --port argument. Connect to it via the URL printed in the console - e.g.
meteor --port 3001
http://localhost:3000/.
If you have settings.json then run meteor --settings settings.json

Resources