i just generated a new application (phoenix v1.1.4) but when i run the server i see an error in my browser (javascript )
error
Cannot find module "phoenix_html" from "web/static/js/app" in javascript console
Please include phoenix version, elixir version, npm version and node version.
phoenix 1.1.4
Elixir 1.2.0
node v5.5.0
npm 3.3.12
Please run:
mix deps.get
npm install
Make sure you run the first one before the later. If it doesn't work, please paste your package.json. Is it a new application you just created?
mix deps.get
Running dependency resolution
All dependencies up to date
npm install
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN EPACKAGEJSON simple_chat No license field.
it's an application (simple_chat) that i generated this morning using mix phoenix.new
package.json:
{
"repository": {
},
"dependencies": {
"babel-brunch": "~6.0.0",
"brunch": "~2.1.3",
"clean-css-brunch": "~1.8.0",
"css-brunch": "~1.7.0",
"javascript-brunch": "~1.8.0",
"uglify-js-brunch": "~1.7.0",
"phoenix": "file:deps/phoenix",
"phoenix_html": "file:deps/phoenix_html"
}
}
That's so weird. can you please put it on github? I will take a look at it. Which OS are you using?
os: windows 10
repo: https://github.com/supernova23/simple_chat
I just confirmed yhat versions before 1.1.4 do not have this problem
Ah, please change "brunch": "~2.1.3" in your "package.json" by "brunch": "~2.2.3". that should fix it.
Actually, I may be wrong. The solution may be to keep it as ~2.1.3 and run this:
npm install [email protected]
See #1493.
sorry but that doesn't solve the issue I will downgrade to an older version until we solve this problem thank you for your time
Just in case someone stumbles on the same error, in your brunch-config.js make sure you have:
npm: {
enabled: true
}
still facing the same issue
Has anyone seen this problem recently? It is showing up for us when trying to build a container, works find on the development PC but get the error inside the container.
Version: webpack 4.41.5
s/app.js
Module not found: Error: Can't resolve 'phoenix_html' in '/app/assets/js'
Using exactly the Dockerfile from HexDocs
And tried updating to the elixir:1.10.0-alpine image to same effect.
run mix deps.get before you compile your assets. The js stuff is provided through the phoenix hex packages.
Most helpful comment
Please run:
Make sure you run the first one before the later. If it doesn't work, please paste your package.json. Is it a new application you just created?