Search code examples
meteorangularconsoleangular2-meteor

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


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?


Solution

  • 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.