jejuro
From today morning, I CAN’T generate a new Phoenix app, because it stops at command “npm install && node node_modules/webpack/bin/webpack.js --mode development” with error messages like below.
ERROR in ./js/app.js
Module build failed: Error: Package exports for ‘/Users/Jupeter/hello/assets/node_modules/@babel/helper-compilation-targets’ do not define a ‘.’ subpath …
…
or;
ERROR in ./js/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Package exports for ‘/Users/Jupeter/hello/assets/node_modules/@babel/helper-compilation-targets’ do not define a ‘.’ subpath …
…
To solve this issue, I have spent a few hours including updating npm, webpack, and babel etc., but all efforts are in vain.
Any idea?
Thanks in advance.
PS> I asked it on stackoverflow with more details.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mindok
Hi @jejuro,
I don’t know much about webpack, but it is looking like the issue is in there. Are you able to put up a sample broken project on github (or similar)? These kinds of things are really hard to troubleshoot with a couple of error messages - there’s probably some conflicting packaging tool version or similar, but really hard to see without webpack.config.js, package.json, package-lock.json etc.
kokolegorille
You could try with Phoenix 1.4.10. (You are using 1.4.0)
And then, You might also try to add a babel.config.js in assets/
wolfiton
If you do not care about the version of phoenix you are using then install asdf link(to isolate other system issues) then install Erlang and Elixir and install phoenix the latest version and it should work well. That is my current setup and i have no problems.
Also change npm with yarn, fewer errors and easy to add assets with these commands:
With these tools you shouldn’t have any problems in the future.
jejuro
https://github.com/jejuro/broken_islands_interface
Would you see the files for a moment? Thank you
jejuro
Thanks wolfiton
Would you explain how to use asdf in detail? I have read official docs of asdf, but still can’t grasp how to use it step by step. I tried;
$ asdf install erlang latest
$ asdf install elixir latest
There is no phoenix module, so “asdf install phoenix latest” is not working. I have set the current version as elixir 1.9.4.
$ asdf global elixir 1.9.4
Then, what is the next step?
jejuro
Now…
$ asdf current
elixir 1.9.4 (set by /Users/Jupeter/.tool-versions)
erlang 22.2.1 (set by /Users/Jupeter/.tool-versions)
If I wanna start a new phoenix app, is the command below different from previous ones before using asdf?
$ mix phx.new islands_interface --no-ecto
Or, should I use asdf for babel, webpack too?
mindok
mix archive.install hex phx_new 1.4.11(from Installation — Phoenix v1.8.8)
jejuro
I already installed it before using asdf…
Anyway, I install it again, and try mix phx.new …
mindok
What’s your OS out of interest?
jejuro
oh… Mac os 10.13.1
and, the same problem continues at “npm install && node node_modules/webpack/bin/webpack.js --mod”
ERROR in ./js/app.js
Module build failed: Error: Package exports for ‘/Users/Jupeter/islands_interface/assets/node_modules/@babel/helper-compilation-targets’ do not define a ‘.’ subpath