Sandeep-Suthar9467

Sandeep-Suthar9467

Issue upgrading - cannot define module Phoenix.View because it is currently being defined in

**Elixir Version:** 1.13.4
**Erlang/OTP Version:** 24.3.4.4

**Phoenix Version (Before Upgrade):** 
  - {:phoenix, "~> 1.6.0"}
  - {:phoenix_html, "~> 3.0"}
  - {:phoenix_live_dashboard, "~> 0.5"}

  **Phoenix Version (After Upgrade):**
  - {:phoenix, "~> 1.6.16"}
  - {:phoenix_html, "~> 3.2"}
  - {:phoenix_live_dashboard, "~> 0.6"}

Steps to Reproduce:

Afrer upgrading to Phoenix dependencies in mix.exs:
elixir defp deps do [ {:phoenix, "~> 1.6.16"}, {:phoenix_html, "~> 3.2"}, {:phoenix_live_dashboard, "~> 0.6"}, # other dependencies ] end

I have actually ran the following commands in order to try and fix the error.

```bash
mix deps.clean --all
mix deps.get
```

& I have attempted to compile the project using the follow mix command, but I am receiving issues.
bash mix compile

Expected Behavior:
The project should compile successfully without errors.

Actual Behavior:
The following compilation error occurs:

== Compilation error in file lib/phoenix_view.ex ==
** (CompileError) lib/phoenix_view.ex:1: cannot define module Phoenix.View because it is currently being defined in lib/phoenix/view.ex:1
    (elixir 1.13.4) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
could not compile dependency :phoenix_view, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile phoenix_view", update it with "mix deps.update phoenix_view" or clean it with "mix deps.clean phoenix_view"

Reason for Upgrade:
I am upgrading the Phoenix version to address a security vulnerability in wildcard check_origin configurations.

I would appreciate any guidance or suggestions to resolve this issue. Thank you for your help!

Marked As Solved

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Usually things like gitlab.yml have a way of caching some of the build artifacts between runs, to help improve compilation time. In this case you want to make sure to clear out that cache or else you’ll have the same issue.

If you can show as much of that file as possible that’s probably a good idea.

Where Next?

Popular in Questions Top

Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement