I have an app I'm writing using Meteor, Angular2 (using the angular-meteor package), Typescript, and MongoDB. I'm trying to put it up on Heroku and running into difficulties. I'm using this meteor buildpack. I'm not sure whether the problems are with Meteor, Heroku, or Angular2, though I suspect it's something Heroku isn't configuring correctly for Angular2. The site is at http://alfred-zahner.herokuapp.com/ and the error I'm getting is:
EXCEPTION: No provider for t! (e -> t)
I've checked the Heroku logs and there is no sign of trouble there. Part of my problem is that I can't see what t and e are, as someone (Heroku?) is uglifying the JavaScript. I'm not really sure how to proceed in debugging this.
One way to solve this problem would be to figure out and fix the error, but I'd be happy if there's a better build pack, or even a better (must be free!) hosting environment that I could be using.
Edit
It's not Heroku's problem. The same thing happens when deploying to Meteor's built in deployment testing (meteor deploy site.meteor.com). If I deploy using meteor deploy --debug site.meteor.com, however, it works, so Angular2 has some problem with the extra processing that happens when Meteor prepares an app for production.
On the angular2-meteor Github I found out that this is an issue with Angular 2 in particular, when using UglifyJS. For now, it seems the only solution is to use meteor deploy --debug. I'm planning to just use that on meteor's built in hosting until Angular 2 plays nicely.
Related
I am trying to deploy my next js app that uses mongodb and mongoose. Everything works fine on localhost however when I deploy to vercel I'm getting this error from the logs:
I have double-checked my environment variables and everything seems fine with them.
Here is my mongo connection:
Here are the pages that bring in data using getServerSideProps:
Any help would be much appreciated!
Try to make mongo DB queries inside the getServerSideProps function. It is mentioned in the NextJS documentation.
And try to build locally first.
Make sure to change the ENV files on the vercel before building.
First I'd like to describe my set up:
I have a web service, let's call it "Cars", written in Java, that I've tested in eclipse with tomcat v6, working local (it was a requirement, so that once it works locally I can switch to do it with a "real" tomcat server so others can access). It works, it access the database, it offers an answer for certain URIs and so on.
I have coded in Plunker an angular 2 application, "WebCar", and I now want to run that on my computer, with a Tomcat server (unless there is a better way of doing it, I've been told to do it with Tomcat. Since I do not know any better option, that's why I talk about tomcat all of the time). With eclipse, I have already managed to get the app running, using palantir plugin for typescript https://marketplace.eclipse.org/content/typescript , and then running the project with a server-launch.js which contains require('lite-server'); , this allows me to see the same I saw on plunker, so, it works, but before I upload anything to the business servers I wanted to check everything works (hence the set up, which may not be necessary but it's what I come up with).
I now want to go one step further and use, if possible, tomcat v6 to run my angular 2 app, instead of simply using that lite server, so that I can test that it works, and then uploading it to a "real", remote server.
I would like to know what options are there, what would be a better option, and anything that is required to make an angular 2 deployment properly. So far I've found this
https://stackoverflow.com/a/34408495/6028947 " You only have to deploy
.js files, since anyway browser won;t" which I don't fully get,
http://jspm.io/ which is for SystemJS (I have an older version of
Angular 2 and use config.js)
https://stackoverflow.com/a/37568235/6028947 which talks about
angular-cli or webpack, which makes a bundle but if I got that
running, I still don't know what to do with it to upload to Tomcat
and then connect it to my web service.
So maybe the question should be (I don't know for sure): Once you get your angular 2 code bundled, what's next?
Btw there are a few other questions on stackOverflow, similar to this, but as far as I've seen, without any answer at all or with answers only obliquely related to this (and of course, nothing resembling a guide or step by step required)
Thanks to #nuzz for this ..
I'm running a little script to build the project and then copy it to tomcat. I'm telling angular what the base directory is that it will run under in tomcat.
#!/bin/sh
ng build --base-href /angular/ --prod
mkdir -p /home/xxx/apache-tomcat-8.0.37/webapps/angular
cp -R /home/xxx/angular-clitest/dist/* /home/xxx/apache-tomcat-8.0.37/webapps/angular/
Once thats run, start tomcat and you can access it at: http://localhost:8080/angular
For various reasons we have decided to try to sidestep the slug-compilation and build our own slug locally to deploy through the API (as described here: https://devcenter.heroku.com/articles/platform-api-deploying-slugs).
The slug is built mostly like the java/scala buildpack using that buildpack jvm and is then combined with our play framework application dist file. Looking at the app dir of a normal/git-deployed app it looks aboutish the same.
Now, after deploying the slug through the api we get the expected dynos listed in the config page but the app crashes right away without giving any further information. Trying to attach a bash shell through heroku run bash it just times out.
Is there any way to get more information about why the app crashed out of heroku?
Ok, after some help from heroku support we figured out the following:
The slug tar files must be created so that the paths start with './' regular relative paths doesn't cut it. When we had that figured out we didn't really have any more big problems and now we have got a working alternative build and deploy to heroku pipeline that allows us to build or app locally and then deploy that.
I'm developing a Meteor app on cloud9 (c9.io) which is stuck on Meteor v0.5.9.
I'd like to try my app with 0.6.5.1 as I'm having a few unexplained issues.
Q: Is it possible to do a
meteor deploy myapp.meteor.com
and specify the version of Meteor.
I'm assuming not, as I guess everything's packaged up and deployed together, including Meteor itself?
Specify what version of Meteor to use locally suggest you can specify meteor versions, so may be I should set that just before deployment?
Thanks in advance.
Yes. In fact, it's the same argument as in the other question:
meteor deploy --release <tag of meteor> myapp.meteor.com
The tags are the same as in https://github.com/meteor/meteor/releases but without the release/ prefix.
However, in your case, the current version is 0.6.5.1 so if you just did a meteor update on your machine, that would be the default release for any deploy or bundling. Beware that it will be hard to go back to a previous version because of the various changes it will make.
Can someone help me to move my Symfony 2 application into production mode?
Currently, the application is running properly in /app_dev.php.
I'm googling, but I'm not finding a definite guide for deployment in Symfony 2.
Couple more things to consider:
php app/console cache:clear --env=prod --no-debug
php app/console assets:install web_directory
php app/console assetic:dump web_directory
You might also run into permission issues with the cache directory. I would actually first make sure everything works in development mode on the server before switching to production mode. And if all you get is blank screens in production mode then set debug to true. And of course know how to check your error logs.
Moving Symfony2 to production means :
access the application through : app.php/
Test dev bundles won't be loaded since there is a condition into the AppKernel.php when you use app.php. If you want to unload bundle that should be used only in dev, you can place them into the this section (in appKernel.php)
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Sf2gen\Bundle\GeneratorBundle\Sf2genGeneratorBundle();
}
You also need to make some server tuning by désactivating xdebug and adding eacclerator (or someting else for caching performance)
I also advice to rename app_dev.php to disactivate dev mode
Basic configuration information can be found here:
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
One important spot where many people stumble is asset management. When accessing the app via the app.dev front controller (see fist link), it may be necessary to dump the assets first. Read all about it here:
http://symfony.com/doc/current/cookbook/assetic/asset_management.html#cookbook-assetic-dumping
The Symfony CookBook has now a few recipes about deployment covering:
standard linux-based web-server: How to Deploy a Symfony2 Application,
Microsoft Azure Website Cloud: Deploying to Microsoft Azure Website Cloud,
Heroku Cloud: Deploying to Heroku Cloud.
Symfony2
How to Master and Create new Environments
http://symfony.com/doc/current/cookbook/configuration/environments.html