GithubHelp home page GithubHelp logo

Comments (21)

mizzao avatar mizzao commented on July 17, 2024

I'm guessing that running locally uses npm to pull in the ShareJS library, but demeteorizer doesn't do that and hence there is not going to be a .npm folder where the static file is expected to be served from.

https://github.com/onmodulus/demeteorizer says you need to do npm install on the server; did you do this prior to running?

from meteor-sharejs.

swese44 avatar swese44 commented on July 17, 2024

Yes it gets run by the Modulus CLI command "modulus deploy". I'll open an issue with them and keep this issue updated.

from meteor-sharejs.

mizzao avatar mizzao commented on July 17, 2024

It doesn't sound exactly like a modulus problem then. Maybe the issue is that all the npm modules go to one place, while, the packages/mizzao_sharejs/.npm path is not rewritten in the code itself.

You may have to do some manual post-processing of the code to make it work. There's probably a better way to do this that does not involve using the funny path, but I haven't figured out a way yet.

from meteor-sharejs.

brg2 avatar brg2 commented on July 17, 2024

Hello. I'm having a similar issue after deploying to modulus.

{"line":"405","file":"webapp_server.js","message":"Error serving static file Error: ENOENT, stat '/mnt/data/2/programs/web.browser/packages/mizzao_sharejs/.npm/package/node_modules/share/webclient/ace.js'","time":{"$date":1426805272482},"level":"error"}

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

Same exact issue here as above with modulus :(

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

Demeteorizer relies on the meteor bundle command to generate all of the
required assets for the packages included in a project. It looks like bundle is
not copying over the .npm directory for some reason. :/

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

I pushed a possible fix for this to demeteorizer, try running from the
include-npm branch of demeteorizer and see if that works.

You can do that by installing from the repository:

$ npm install -g onmodulus/demeteorizer#include-npm

I was able to demeteorize and correctly run the demo included in this repository,
but that doesn't guarantee that it will catch all cases. Let me know if anything
fails.

For those deploying to Modulus, you'll have to install demeteorizer using the
command above then deploy from the .demeteorized directory that is created
($ demeteorizer && cd .demeteorized && modulus deploy)

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

Hmmm...This did something... Led to another issue...Anyone else get this?

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

EDIT: Apologies, the issue I mentioned above turned out to be unrelated. However, I'm still getting the same error after using the new branch of demeteorizer to upload.

{"line":"419","file":"webapp_server.js","message":"Error serving static file Error: ENOENT, stat '/mnt/app/programs/web.browser/packages/mizzao_sharejs/.npm/package/node_modules/share/webclient/ace.js'","time":{"$date":1440042759134},"level":"error"}

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

@rubencodes what was causing the TypeError: Cannot read property 'done' of null
issue that you were seeing? I ran into that while testing some changes.

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

I'm not entirely sure... I just followed the steps a second time and it no longer gave me that error, it just gave me the old error :(
So no idea what caused it to begin with... Now it's uploaded, it's started, it just fails with the og error whenever I do anything related to the Ace editor.

Also: Just noticed I'm running an older version of modulus, going to update to 4 and see fi that changes anything.

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

No dice on newest modulus version, same error :/

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

Try again from that branch, remove and update (I force pushed the changes).

$ npm rm -g demeteorizer && npm install -g onmodulus/demeteorizer#include-npm

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

No dice :( Same issue...When I load the page I get a failed GET request to http://[my domain]/packages/mizzao_sharejs/.npm/package/node_modules/share/webclient/ace.js

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

This is going to get weird, but bear with me.

Let's take demeteorizer out of the equation by bundling the application using
meteor build and seeing if that works. Here are the steps to deploy to Modulus
without using demeteorizer (brace yourself!).

Bundle the app (make sure to put your *.onmodulus.net URL here):

$ meteor build --server <your-project-url>.onmodulus.net --directory .modulus-deploy --architecture os.linux.x86_64

Edit package.json to add the correct node version and main file. 🚨 This part is
super important to make sure everything runs correctly

$ cd .modulus-deploy/bundle
$ vim programs/server/package.json

With that open add the following lines somewhere within the file (within the main {}).

"engines": { "node": "0.10.36" },
"scripts": { "start": "node ../../main" },

Finally, deploy from the .modulus-deploy/bundle directory and include modules.

$ modulus deploy --include-modules

This method completely avoids any demeteorizer voodoo. My fingers are crossed. :)

from meteor-sharejs.

mizzao avatar mizzao commented on July 17, 2024

I don't know if that will always work due to the weird binary dependencies in ShareJS, but as long as you build and deploy on the same type of system (i.e. linux x64) that should be fine.

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

Hmm...I added the lines as indicated (triple checked that they were added), but I'm getting the following:

Found package.json: ./programs/server/package.json
WARNING: Main file not specified in package.json.
WARNING: Looking for common main file names: index.js, app.js, server.js, main.js.
ERROR: No main or start script found. There is no application to run.

Should there be a "main" file in the ../../ directory from the package.json? Because all I've got is:

client      packages    server      smart.lock
lib     public      smart.json

at the ../../ directory.

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

@rubencodes the bundle should look about like this:

.
├── bundle
│   ├── README
│   ├── main.js
│   ├── programs
│   │   ├── server
│   │   │   ├── app
│   │   │   │   └── leaderboard.js
│   │   │   ├── assets
│   │   │   │   └── packages
│   │   │   │       └── boilerplate-generator
│   │   │   │           ├── boilerplate_web.browser.html
│   │   │   │           └── boilerplate_web.cordova.html
│   │   │   ├── boot-utils.js
│   │   │   ├── boot.js
│   │   │   ├── config.json
│   │   │   ├── mini-files.js
│   │   │   ├── npm
│   │   │   ├── npm-shrinkwrap.json
│   │   │   ├── package.json
│   │   │   ├── packages
│   │   │   ├── program.json
│   │   │   └── shell-server.js
│   │   ├── web.browser
│   │   │   ├── 7f34d936fe9105bb301647e4132ec8c80f148a96.js
│   │   │   ├── e60597c923303d5681465135816d98a110781aae.css
│   │   │   ├── head.html
│   │   │   └── program.json
│   │   └── web.cordova
│   │       ├── aadf8805f63511af904f07b3b76b654a6c33aae3.js
│   │       ├── e60597c923303d5681465135816d98a110781aae.css
│   │       ├── head.html
│   │       └── program.json
│   ├── server
│   └── star.json
└── ios

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

Alright, I got the directions just a little wrong, change the start
section to "scripts": { "start": "node ../../main" },

Sorry about that!

from meteor-sharejs.

rubencodes avatar rubencodes commented on July 17, 2024

IT LIVES!!! Thank you! This worked perfectly! So is this just some sort of issue with demeteorizer?

from meteor-sharejs.

fiveisprime avatar fiveisprime commented on July 17, 2024

Yeah, demeteorizer uses the old bundle command over build, which seems to
have an impact on the structure of the output.

I've started the effort of rewriting demeteorizer to use build, but it will
take some time to get there. I suggest using this manual method for now.

from meteor-sharejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.