geolessel / react-phoenix

Make rendering React.js components in Phoenix easy
http://reactphoenix.com
MIT License
504 stars 38 forks source link

Cannot install phoenix 1.2 #20

Closed Christian24 closed 6 years ago

Christian24 commented 7 years ago

Hello everybody, this seems great, but I cannot get it to run: As in https://github.com/geolessel/react-phoenix/issues/18 I had to update my debs like so:

{:poison, "~> 2.2", override: true},
{:react_phoenix, "~> 0.4.2"}

I also had to install react-stdio using npm otherwise it would not compile. However, when I try to start a server I get those errors:

Using outdated versions of react-phoenix, trying to update to match package.json versions
01 Jul 22:22:51 - info: Installing npm packages...
(removed not interesting stuff)
Resolving deps of web/static/js/app.js failed. Could not load module 'react-phoenix' from '/Users/Christian/Documents/blog/web/static/js'. Possible solution: run `npm install`. 

package.json:

"dependencies": {
    "draft-js": "^0.10.1",
    "draft-js-plugins-editor": "^2.0.0-rc2",
    "phoenix": "file:deps/phoenix",
    "phoenix_html": "file:deps/phoenix_html",
    "react-phoenix": "file:deps/react_phoenix",
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  },
  "devDependencies": {
    "babel-brunch": "^6.0.6",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "brunch": "2.7.4",
    "clean-css-brunch": "~2.0.0",
    "css-brunch": "~2.0.0",
    "javascript-brunch": "~2.0.0",
    "react-stdio": "^3.1.0",
    "uglify-js-brunch": "~2.0.1"
  }

Am I missing something or have the requirements for installation changed?

Additional question: I plan to use React in only certain parts of the backend, is it possible to ommit the JS for all other pages?

Thanks a lot in advance.

geolessel commented 7 years ago

@Christian24 I've just published v0.4.3 with a couple of workarounds for react-stdio stuff. Can you try updating your used version to 0.4.3 and see if that fixes things up?

Christian24 commented 7 years ago

Sorry for the late response.

I created a new empty project now, but the error is still pretty much the same:

Running React.Endpoint with Cowboy using http://localhost:4000
23 Jul 00:22:54 - info: Using outdated versions of react-phoenix, trying to update to match package.json versions
23 Jul 00:22:54 - info: Installing npm packages...
23 Jul 00:22:57 - info: compiling
23 Jul 00:22:57 - error: Resolving deps of web/static/js/app.js failed. Could not load module 'react-phoenix' from '/Users/Christian/Documents/reacthpeonix/react/web/static/js'. Possible solution: run `npm install`. 

package.json:

"dependencies": {
    "babel-preset-env": "^1.6.0",
    "babel-preset-react": "^6.24.1",
    "phoenix": "file:deps/phoenix",
    "phoenix_html": "file:deps/phoenix_html",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-phoenix": "file:deps/react_phoenix"
  },
  "devDependencies": {
    "babel-brunch": "~6.0.0",
    "brunch": "2.7.4",
    "clean-css-brunch": "~2.0.0",
    "css-brunch": "~2.0.0",
    "javascript-brunch": "~2.0.0",
    "uglify-js-brunch": "~2.0.1"
  }

mix.exs:

defp deps do
    [{:phoenix, "~> 1.2.4"},
     {:phoenix_pubsub, "~> 1.0"},
     {:phoenix_ecto, "~> 3.0"},
     {:postgrex, ">= 0.0.0"},
     {:phoenix_html, "~> 2.6"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:poison, "~> 2.2", override: true},
     {:react_phoenix, "~> 0.4.3"},
     {:gettext, "~> 0.11"},
     {:cowboy, "~> 1.0"}]
  end

I still had to override poison.

geolessel commented 6 years ago

@Christian24 I've published v0.5.0 which removes all the server-side rendering stuff that didn't really work for the majority of people anyway. If you upgrade to v0.5.0, do you still have this issue?