My meteor application works locally. When I bundle it (using meteor bundle myapp.tgz), upload it on my server and launch it, I have the following error upon opening the page on Chrome console:
Uncaught SyntaxError: Unexpected token <
On Firefox console:
SyntaxError: syntax error
[Break On This Error]
<!DOCTYPE html>
In order to try to find the origin of the error, I used an old bundle that was working. I can see the problem is that the files in static_cachable are not found.
Meteor is still trying to use the files from the old bundle.
If I rename the new bundled files in static_cachable to the old name then It works.
I checked in all files contained by the root of the bundle folder and references are correct (they are pointing to the new names).
It there some cache somewhere that keep the reference to the old static_caches files ?
To avoid the error, one has to restart Meteor after deployement :
rm -rf bundle
tar -zxf myapp.tar.gz
cd bundle/server/node_modules/
rm -r fibers
npm install fibers#1.0.0
export PORT=32632
export MONGO_URL=mongodb://meteor:**#localhost:18700/moviegrid
export ROOT_URL='mydomain.com'
nohup node bundle/main.js &
Look at the javascript console when you load your app locally and check if there is no error. If there is some, correct them before bundling/deploy.
This may not be your problem but according to http://docs.meteor.com/#deploying:
For now, bundles will only run on the platform that the bundle was created on. To run on a different platform, you'll need to rebuild the native packages included in the bundle. To do that, make sure you have npm available, and run the following:
$ cd bundle/server/node_modules
$ rm -r fibers
$ npm install fibers#1.0.0
Consider installing meteor on your server, cloning your app directory and using meteor run inside the directory to see if the app runs in development on the server.
If it successfully launches in development then bundle it on the server and use those files. Or just run with meteor --production
Related
I'm trying to setup a Laravel project on Valet.
I'm getting this error:
Warning: require(/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Fatal error: require(): Failed opening required '/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Trying to link either the project root or /public folders results in the above error instead of Laravel's default welcome screen.
How do I resolve this?
Try to navigate to the project folder root and run the command:
composer -i
sudo chmod 755 -R folder_name
Create the .env file, if is fresh application just copy the content of the .env.example file.
inside the project folder again: php artisan key:generate
After those steps all up and running for me :)
Solves the issue for me.
Looks like you have a fresh installation of laravel here...or, you just cloned the repo?
If so, the first thing you should do is to try and install the packages that Laravel uses.
Within those packages is a file called "autoload.php" which your server is looking for here.
Now, to do that, simply navigate within your terminal to the directory of your project and run: composer install.
Wait for it to finish and then, try to continue from there.
I am following a tutorial on Ionic Angular and it has come to the point where the instructor is having me publish my code to Firebase Hosting. First I used NPM to install the Firebase CLI. Then I was instructed to use the firebase init command. The issue is that the CLI doesn't seem to recognize the current directory that is selected in my terminal.
I run: cd /Users/MyUserName/myProjectsFolder/myProject/
Then I run firebase init and it displays:
You're about to initialize a Firebase project in this directory:
/Users/MyUserName
When I would expect it to read:
You're about to initialize a Firebase project in this directory:
/Users/MyUserName/myProjectsFolder/myProject
A little bit of googling found this page:
https://firebase.google.com/docs/cli/
Which includes this passage:
To initialize a new project directory, change directories in the terminal to your desired project directory and run: firebase init
Based on this I would expect the steps I took to work.
I am confused. Has anyone ever run into this behavior? Can anyone think of a way to get the CLI to function as expected?
Thanks.
Got to folder:
/Users/Username/
Search for a file with name of firebase.json and Delete it.
Reinstall firebase tool with this command (--unsafeper- to avoid
permissions error messages & use sudo):
$ sudo npm install --unsafeper- -g firebase-tools
Then, go to your pubilc folder (you have to create one) which
contains your HTML, JS, images and CSS files and use this command:
$ sudo firebase init
$ sudo firebase deploy
The reset is easy and as mentioned in the firebase
docs:
https://firebase.google.com/docs/hosting/quickstart
The reason is that you must have initiliazed a project in some parent directory (of this myProject folder) in the past. Somehow firebase sees that project in that directory rather than initializing a new project in the current path.
Solution:
Check the parent directories of the path where you want to initialize a firebase project now. Delete / Move the firebase files from that folder and then you should be able to initialize a project in the current directory.
For example:
I also faced the same problem.
I was trying to initialize a project in this path:
D:\Work\Projects\myProject
But somehow it always got initialized in this path:
D:\Work
After some searching it turned out that the reason was that I had initialized a project in
D:\Work directory. I moved those files to another folder and that solved the problem.
I was also facing this problem and windows not able to recognize the firebase. I don't know the exact reason why it was behaving in such a manner but it solved the problem.
1) I installed the firebase-tools using a command on command prompt
npm install -g firebase-tools
and it didn't work.
2) I restarted the machine.
3) then again I executed the same command from step 1) npm install -g firebase-tools
and it worked.
Was trying to do this and discovered a command that allows "firebase" as a command.curl -sL https://firebase.tools | bash This will allow $ firebase login and $ firebase init to work.
I was facing the same issue. After checking the log I figured out that the Authentication token was expired from my firebase cli login session. So I logged out and Logged-In again to the firebase cli using Firebase logout And firebase login command. Problem solved.
To check out your issue go to firebase log using firebase-debug.log command.
And take required steps.
I am trying to use Visual Studio Code as an alternative to Webstorm to edit and debug a toy Meteor app. After installing the MeteorHelper extension which is announced as provided "Meteor CLI integration into VSCode" and try to run any Meteor command I get the error msg:
"X is not a meteor project directory, check your workspace definition".
I don't know whether the problem is the LOCATION of my directory X, or its CONTENT (something is missing?). I changed the meteorhelper.relativeProjectPath string in the settings.json file to various possible values to no avail.
Has anyone out there tried to use VSCode to edit and debug a Meteor app and got that error?
A Meteor project directory is what gets created when using the command:
meteor create my-app
This command creates a folder that contains your Meteor applications' code. Typically, the directory structure looks something like this:
my-app/
.meteor/
client/
imports/
server/
package.json
The error you're describing would be encountered while attempting to run a project-specific meteor command from outside of a Meteor project. In the above example, I would access the project directory by first entering
cd my-app
on the command line.
I am trying to build a Meteor app using meteor build --directory ../dist. Everything seems to build fine, but when I follow the instructions provided in the generated README file I get an error saying the server/main.js file can't load. When I looked, I saw that the main.js file is not there.
Is there something I need to do before I build to ensure the file exists after build?
I'm having a very difficult time trying to build the Meteor app for a production serve, and I can't seem to find any clear instructions. The Meteor doc instructions are very vague in regard to build.
I can see how the README can be confusing if not followed as intended.
The first command line states:
$ (cd programs/server && npm install)
Note the parentheses.
Those cause the command to run in a subshell, which means that your shell will remain in the same directory after the command execution is done.
However, if you only execute the inner commands, you will end up in the programs/server directory and experience what you describe.
In any case, $ node main.js should be run from the bundle's root directory.
I'm getting this error when I try typing $modulus deploy into terminal from my app directory:
Determining Meteor version...
Meteor version: 1.1.0.2
Bundling Meteor App...
undefined
[Error] Error: Command failed: /bin/sh -c cd /Users/xx/Projects/Project1 && meteor bundle --directory /Users/xx/Projects/Project1/.demeteorized
This command has been deprecated in favor of 'meteor build', which allows you
to build for multiple platforms and outputs a directory instead of a single
tarball. See 'meteor help build'for more information.
WARNING: The output directory is under your source tree.
Errors prevented bundling:
While building the application:
client/Project1.js:138:29: Unexpected token =
I get the same result with $demeteorizer. It worked on an old version of the app, then I added some features in new branch, merged, and now I'm getting this error.
Already tried:
sudo npm update -g modulus
Turns out it was an actual error in my code. I had an extra closing curly brace somewhere.