-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Phoenix 1.3 #10
Comments
OK, figured it out a minute later (duhhh)... it's the It needs to be this:
Instead of this:
|
I'll reopen this as a reminder to update the docs (when I have the time) to be more clear. |
@geolessel actually, it might be a good idea to keep this open for another reason. I can't get the installation to work. I followed the steps in the Readme and in the moduledoc, but I'm getting an endless output in the console each time I try to launch the Phoenix server:
I did change my config.exs to this: config :react_phoenix,
compiled_path: Path.join(["priv", "static", "js", "components"]),
react_stdio_path: Path.join(["assets", "node_modules", ".bin", "react-stdio"]) PS: Also, why do we need to add react manually to our dependencies in package.json? Aren't these already a dependency of the lib? I mean this lines:
|
After some investigation, it seems like configuring |
I'm experiencing the same thing as @abitdodgy regarding |
@scmx I managed to get client side rendering working on my fork. I'll submit a pull request here once I get it fully working (if you or @geolessel can help me get to the bottom of an error for server side rendering, I would appreciate it). But I made some adjustments. You want to change a few things to the following:
At this point client side rendering is working. But server side rendering produces this error:
But the file does exist in that location and it is compiled. I'm assuming it's something to do with Any ideas? PS: @scmx I'm using my form, where I changed
I just appended an |
@abitdodgy @scmx As for the I'm thinking through a separate section of the README for Phoenix 1.3 and 1.2 since there are so many changes. |
@abitdodgy @scmx I also figured out the "Cannot load component" failure. I struggled quite a bit to figure this one out and did so mainly in the command line and outside of Phoenix/Elixir since it was mainly a node/js issue. It turns out this is the answer to @abitdodgy's question about why we need to require react in our own Hopefully that clears up the remaining questions for you guys. I think that plus making sure you |
@geolessel thanks for digging around for this issue. I added the lines to package json. It's now identical to that in the readme, except with Phoenix 1.3 paths. I also cleaned up the deps, but I'm still having the same issue. Did you make the same changes I did, or did you do something differently? |
@abitdodgy 🤔 I'm not exactly sure what errors your getting at the moment nor the cause without looking at your app code. In order to help get you going (and others having similar issues), I've created a new repo that contains an example Phoenix 1.3 app that uses both server-side and client-side rendering. Check it out here: https://github.com/geolessel/react-phoenix-example-1.3 If you'd like, look at each commit (https://github.com/geolessel/react-phoenix-example-1.3/commits/master) as I step through each step of the setup from Is that helpful? |
@geolessel I just forked your example repo (thanks for creating it) and had the same issue. I can only imagine this is a problem with my node installation? I deleted and reinstalled node using homebrew and had the same issue. I'm a but stumped to be honest. |
@abitdodgy hmm, that's too bad. What version of node are you running ( |
@abitdodgy I think I figured it out and it's an issue on my end. I don't think server-side rendering is consistently working at the moment. I'll update you when I figure it out. |
@geolessel thanks for the heads up. Please keep me posted if you find something new. Thanks! |
@geolessel any news on that? Can you share any clues, where to search for the problem, so we can poke around and try to provide solution. |
…tion. Fixes geolessel#10. config :react_phoenix, compiled_path: Path.join(["priv", "static", "js", "components"]), node_modules_path: Path.join(["assets", "node_modules"]) # <-- ADD THIS
@geolessel Did you ever figure out the issue with server-side rendering? |
I am having the issue that displays:
I'm quite confident my installation is correct. Any idea what's going on? |
@abitdodgy @scmx @vestimir @jpinnix @BenMusch I apologize for my absence from this thread. I would blame it on the fact that I cannot stand Github's notification system (please just email me when something happens in my repo), but that doesn't excuse me for not popping in here every once in a while to see what's up. In the end, I decided that server-side rendering was causing more issues than was reasonable for a current Elixir package, so I have removed it in #24 (v0.5.0). FWIW, I honestly had it working when I created the server-side rendering code. However, subsequent attempts were touchy at best. I think what I have surmised is that for every time I did get it working, I had If you'd like to continue trying to get server-side rendering working, please update me on your progress. If we can get it working and documented well, I'd love to add it back in. v0.5.0 only removes all the old server-side code and updates the README for Phoenix 1.3. No new features or changes are there except for deleting server-side stuff, so feel free to continue to experiment with v0.4.3. |
I'm trying to use this lib with Phoenix 1.3 and I get the following error on
npm install
:I'm assuming this is to do with
assets
moving into the root in Phoenix 1.3. What's the best way to solve this?The text was updated successfully, but these errors were encountered: