ammy

ammy

Couldn't resolve phoenix framework - [ERROR] Cannot read directory "../..": operation not permitted

while I try to give the command (mix phx.server) in the vs code terminal
I am getting some errors.

You can mark the path "phoenix_live_view" as external to exclude it from the bundle, which will remove this error.

5 errors
[watch] build finished
[watch] build started (change: "../..")
✘ [ERROR] Cannot read directory "../..": operation not permitted

✘ [ERROR] Could not resolve "bootstrap"

    js/app.js:4:7:
      4 │ import "bootstrap"
        ╵        ~~~~~~~~~~~

  You can mark the path "bootstrap" as external to exclude it from the bundle, which will remove this error.

✘ [ERROR] Could not resolve "phoenix_html"

    js/app.js:23:7:
      23 │ import "phoenix_html"
         ╵        ~~~~~~~~~~~~~~

  You can mark the path "phoenix_html" as external to exclude it from the bundle, which will remove this error.

✘ [ERROR] Could not resolve "phoenix"

    js/app.js:25:21:
      25 │ import {Socket} from "phoenix"
         ╵                      ~~~~~~~~~

  You can mark the path "phoenix" as external to exclude it from the bundle, which will remove this error.

✘ [ERROR] Could not resolve "phoenix_live_view"

    js/app.js:26:25:
      26 │ import {LiveSocket} from "phoenix_live_view"
         ╵                          ~~~~~~~~~~~~~~~~~~~

  You can mark the path "phoenix_live_view" as external to exclude it from the bundle, which will remove this error.

5 errors
[watch] build finished
[watch] build started (change: "../..")
✘ [ERROR] Cannot read directory "../..": operation not permitted

Most Liked

al2o3cr

al2o3cr

It seems like the build tools aren’t finding a directory they’re supposed to - can you post the top part of your app.js, or wherever that ../.. path is coming from?

al2o3cr

al2o3cr

General note: I’ve reformatted your post to use triple-backticks (```) for code formatting. This is especially important in this situation because otherwise Markdown converts .. to .. which is SUPER CONFUSING :slight_smile:

I don’t think it’s related - but can you tell us more about whatever alternative CSS pipeline that’s being used here?

Back to your original question, I don’t see anything notably unexpected in your app.js which makes me suspect esbuild’s configuration. What does your configuration (generated in config/config.exs by default) look like? Here’s the version from the Phoenix generator:

https://github.com/phoenixframework/phoenix/blob/3cf1f1065ce11a906bd04b7841814cdced3f0df2/installer/templates/phx_single/config/config.exs#L34-L42

That NODE_PATH bit at the end is critical - it makes lines like import "phoenix_html" work correctly. If it was misconfigured, you’d see exactly the errors you are currently seeing.

Where Next?

Popular in Questions Top

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
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
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
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
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
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
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement