DiegoUreno

DiegoUreno

Could not resolve "phoenix_html"

I recently upgrade Phoenix from 1.5.12 to 1.6.2 but im getting an error everytime i tried to run the server.
This is the error.
`
mix phx.new test
cd test
mix ecto.create
mix phx.server
error: Cannot read directory “../../../../..”: operation not permitted

js/app.js:23:7: error: Could not resolve “phoenix_html” (mark it as external to exclude it from the bundle)
23 │ import “phoenix_html”
╵ ~~~~~~~~~~~~~~

js/app.js:25:21: error: Could not resolve “phoenix” (mark it as external to exclude it from the bundle)
25 │ import {Socket} from “phoenix”
╵ ~~~~~~~~~

js/app.js:26:25: error: Could not resolve “phoenix_live_view” (mark it as external to exclude it from the bundle)
26 │ import {LiveSocket} from “phoenix_live_view”
╵ ~~~~~~~~~~~~~~~~~~~

4 errors
`
I’ve tried giving “full disk access” to the terminal, but it doesn’t work out, I don’t know what to do.

Oh, and my versions are this:
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [dtrace]

Elixir 1.12.2 (compiled with Erlang/OTP 24)

macOS Big Sur v11.6 M1

Marked As Solved

japplegame

japplegame

I believe that the reason is the wrong path to the dependencies folder. In an umbrella application dependencies are not in the application folder, but in the root folder.
Try to change that path in config.exs of your phoenix application:

# Configure esbuild (the version is required)
config :esbuild,
  ...
    env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
  ...

change "../deps" to "../../../deps"

Also Liked

sigu

sigu

I get this error when running inside an umbrella app, do you have a way around it?

derek-zhou

derek-zhou

maybe you have an older version of the generator. try:

mix archive.install hex phx_new
clearmind0202

clearmind0202

Are you running the phoenix app inside an umbrella?
I’ve stumbled upon the issue regarding JS imports this morning, and i could only reproduce it under the said condition.

Last Post!

craig

craig

thanks @japplegame, this solved my issues

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement