Boaz Hoch
Boaz Hoch

Reputation: 1229

Meteor fails to run after building a meteor app

Ok so i have a built a meteor app using the command

meteor build bundle --debug --server https://(my app url hosted on meteor)

meteor did built a bundle folder with cordova android pack and a tar.gz file.

after building the app , im trying to hit

meteor

but i get a bunch of errors:

While Building the application:
bundle/android/project/cordova/lib/android_sdk_version.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/appinfo.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/build.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/check_reqs.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/clean.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/device.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/emulator.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/exec.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/log.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/run.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/lib/spawn.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/node_modules/shelljs/scripts/generate-docs.js:1:15: Unexpected token ILLEGAL
bundle/android/project/cordova/node_modules/shelljs/scripts/run-tests.js:1:15: Unexpected token ILLEGAL
bundle/android/project/assets/www/application/head.html:1: bad formatting in HTML template
bundle/android/project/assets/www/application/index.html:1: Can't set DOCTYPE here.  (Meteor sets <!DOCTYPE html> for you)

viewing inside those js files i see the line of code that makes the error, which is:

#!/usr/bin/env node

note because phonegap and cordova outputted for me an error :"/usr/bin/env: node: No such file or directory"

i tried fixing it using ln -s /usr/bin/nodejs /usr/bin/node

of course deleting the bundle folder and hitting "meteor" , does not outputs any error logs and the app is running perfectly.

i guess there is some sort of error with the cordova build...

Upvotes: 3

Views: 2047

Answers (1)

Boaz Hoch
Boaz Hoch

Reputation: 1229

according to Slava:

Meteor picks up all javascript files in your project's folder including nested folders. By saving your bundle in the same directory as your project, you just duplicated a lot of files and now Meteor is going to pick them up as "new source files". To avoid this, output your bundles to a separate directory from your project or to a hidden folder that is ignored by Meteor build tool (any folder name starting with a dot).

EDIT: take a look at meteor cordova phonegap integration:

meteor-cordova-phonegap-integration

meteor build <bundle path> --server <host>:<port>
  • *folder (example home folder)

  • **subfolder (root of project) (example myMeteorApp)

so in order to make things happen try doing consider your on root folder of your app:

meteor build .bundle --debug --server https://(your app url hosted on meteor) //will generate hidden direcotrey with the build inside it.

result in:

  • *folder (example home folder)
  • **subfolder (root of project) (example myMeteorApp)
  • ***.bundle (hidden folder inside your root app folder)

or

meteor build ../bundle --debug --server https://(your app url hosted on meteor) //will generate a direcotrey with the build inside it .

result in:

  • *folder (example home folder)
  • **subfolder (root of project) (example myMeteorApp)
  • **bundle ( folder inside your home folder)

Upvotes: 10

Related Questions