-
Notifications
You must be signed in to change notification settings - Fork 10
"Meteor code must always run within a Fiber" Production Server SSR only. #162
Comments
You know, I just realized that wrapping an async function like This is why meteor-promise was created, it runs its callbacks within
It's also bizarre to me that Meteor chose to use it, because their goal in general was to enable isomorphic code, but when you pick a library that only runs on the server and reaches its tendrils into everything, it kind of gets in the way of isomorphism... |
Man it's my first time with Meteor, and there are so many bizzare things everywhere. I don't even know now if it saved me any time on development :P You sound quite certain with your thoughts. Will you be implementing it in the near future? In the mean time i'll try to hack something out of it or evantually I'll disable SSR for now (which will probably be the case). |
Heh, I hope you didn't get the impression that Crater is the only way to use Meteor! I tried my best to warn about unexpected difficulties like this in the README. Yeah, this evening I'll figure out how to use |
Yeah yeah, I know, I've seen the notice. Nevertheless the stack looked too good not to try it out :D When you get to know the quirks of meteor, crater works really well! Next time maybe I would just use TypeScript instead of flow, but that's all I'd change for now. Anyway, great Thanks for the response, and good luck with the update :) |
@unski11ed hmmm...in my workspace at least it looks like Meteor is already monkeypatching Promise to run callbacks in Fibers, so I'm not sure if the cause of your issue is what I thought... Can you paste the stack trace? |
Heh, upon further investigation (I've just had this error come up in my own project, happy happy joy joy), I realized something worse; I'm stupidly using It may be the case that if I remove |
Oh, I had a similar problem with 'simpl-schema' package - it was confilicting between the client and meteor, can't remember correctly. Ok waiting for the patch, I tried some other stuff: cleaned the code a bit, fibered this and that, but nothing worked so far. |
I found yet another potential issue: I'm using |
i.e. from * `build/meteor/bundle/programs/server/node_modules` * `build/meteor/bundle/programs/server/npm/node_modules` instead of from root `node_modules`. Hopefully this will solve #162 by avoiding duplicate instances of `Promise`, `Fiber`, etc.
Okay, can you try the module-resolver branch? It looks in the Meteor bundle's |
@unski11ed I merged that branch now, let me know if |
@unski11ed any updates on this? |
@jedwards1211 Sorry for the delay, I left SSR for the last step in my project, which quite frankly is now ;) I remade this seed project so it matches my requirements and updated some packages along the way - webpack 3, meteor 1.6.1 (last one using babel 6). After some struggling with forcing Later I started working on the SSR part - I couldn't really just Now the server rendering part works ok - I can see that the HTML contains everything what I need BUT i have an error on the client: The package is present in this directory, but babel somehow can't import it I guess. Can you give me some hints how can I mitigate this problem and/or point where to look for the solution? |
Hi
I uploaded my app written on top of "crater" to my remote machine for the first time. Everything worked fine in local dev and local production, but of course not on the server. After navigating to the page I see a white screen with "Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment."
I found out that it only happens when SSR is enabled which is kind of a problem for me, as I really need it.
The call stack points to a thunk where a Meteor method is beeing called:
I don't really get this whole Fiber thing, but i guess the problem has something to do with fiber + dispatching actions in Redux. Can you somehow point me in the right direction in this case? Should I use some specific dispatches for this?
The text was updated successfully, but these errors were encountered: