Open dmitry-sher opened 7 years ago
the same happened on Debian 4.9.30-2+deb9u2
This probably happened when you updated Meteor. Unfortunately, Meteor 1.5.2.1 changed the behavior of require() such that it will no longer find the capnp module. So if you updated to 1.5.2.1 or later, it won't work anymore. :(
This affected the Sandstorm shell, too. There I solved it with this:
https://github.com/sandstorm-io/sandstorm/blob/master/shell/packages/sandstorm-capnp/capnp.js
For apps, the same thing could work, but I'm not sure if it's the best solution.
The problem is that we're trying to make capnp appear as if it were a system module, so that it doesn't need to be declared as an npm dependency. We don't want it to be an npm dependency because building the npm package would require having libcapnp installed on the system, which is complicated. We'd rather just provide a copy with meteor-spk.
Yep, i totally understand your considerations. The workaround you showed me is working for apps and, what's even more important for me, also for packages.
BTW I think an easier workaround specifically for Sandstorm apps might be to do:
require("/node_modules/capnp.js")
This works since meteor-spk always puts the file in exactly that spot.
@kentonv
I do have const Capnp = require('/node_modules/capnp.js');
in Wekan sandstorm.js .
How do I remove capnp related stuff? I still get the same error.
@kentonv
I get those errors on meteor-spk 0.4.0
@xet7 Which error do you get? Cannot find module "capnp"
? But if you aren't using require("capnp")
anymore, how could you possibly get that error? Or is it a different error?
I fixed that capnp not found error this way in Wekan: https://github.com/wekan/wekan/commit/11e9811f82858a3d98036e142b0da69d867adebc
I was working with this stack:
Everything was working flawlessly until something happened in september-october, around the time sandstorm-214/215 came out. After that, no matter what, my projects were failing to run in sandstorm environment with following error on the server-side:
I've done following:
When i create dev bundle, in deps i can see capnp.js and all relevant files.
I've nailed the problem to simplest project with 1 page and 1 server-side file. On a page it simply shows user info. On server-side we have one file that simply requires
capnp
, doing nothing. This app breaks on my installs. Here is sample project: https://github.com/dmitry-sher/sandstorm-testI can recreate VM again from scratch and provide also the VM. I think this is some problem of my environment. Because one time when i was preparing the test project, it was working, until it broke. Then i did the same steps, and it didn't work.
What can I do? Is it some bug of my environment? Should i simply use some other distro for VM? What is that distro, then?