meteor-css-modules icon indicating copy to clipboard operation
meteor-css-modules copied to clipboard

React-toolbox on both client and server

Open TimBroddin opened this issue 8 years ago • 6 comments

Hi Nathan,

Sorry to bother again. I usually put my app-code in a directory called app so flowrouter-ssr can render it. However, when doing this with react-toolbox I get this error:

Cannot find module './style'

Putting everything back in client works.

This is probably related to #10 or #12 I guess.

(Doing this on Meteor 1.3.1)

TimBroddin avatar Apr 28 '16 17:04 TimBroddin

Definitely not a bother! :smile:

Can you share a repro so I can see exactly what you're seeing?

Thanks!

akanix42 avatar Apr 28 '16 22:04 akanix42

Sure, here you go: https://github.com/TimBroddin/app-dir-bug

If you rename the app dir to client it works.

I couldn't try with 1.1.2 because Atmosphere hasn't built the packages for OS X yet.

TimBroddin avatar Apr 29 '16 07:04 TimBroddin

Hi Nathan: same issue here: when importing any react-toolbox module in an app component, if there is no parent 'client' folder (can be any level up), I get the standard error Cannot find module './style' This probably means no SSR for now. Tested with your meteor-react-toolbox-sample app and with own app, with Meteor 1.3.1

hervejegou avatar May 08 '16 10:05 hervejegou

From my testing, I think Meteor must be handling the server-side files differently from the client-side. I need to dig back into Meteor's file handling for this. Hopefully I can address this this weekend.

akanix42 avatar May 13 '16 04:05 akanix42

Hi Nathan: Thanks and all the best solving this issue. I am really liking react-toolbox with css modules, it is a great setup for Meteor and react. I was also trying to install react-storybook to preview all react components and bumped into the same issue: the storybook local server cannot access all the app components since they must be in a client folder for now to work with css modules.

hervejegou avatar May 15 '16 16:05 hervejegou

Have you tried this with the latest versions of Meteor and React Toolbox? Both have undergone quite a bit of changes so I'm wondering if this is still an issue.

akanix42 avatar Jul 30 '16 00:07 akanix42