jejuro

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.

Showing Posts 1 to 10

mindok

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

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/

module.exports = api => {
  api.cache(true);

  const presets = [
    "@babel/preset-env",
  ]
  const plugins = [
  ]

  return {
    presets,
    plugins
  };
}
wolfiton

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:


yarn add package_name         """add's package directly"""

yarn add -D package_name     """add's package to dev"""

yarn remove package_name     """no matter where it is in dev or not it will remove it"""

With these tools you shouldn’t have any problems in the future.

jejuro

jejuro OP

https://github.com/jejuro/broken_islands_interface

Would you see the files for a moment? Thank you

jejuro

jejuro OP

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

jejuro OP

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

mindok

mix archive.install hex phx_new 1.4.11

(from Installation — Phoenix v1.8.8)

jejuro

jejuro OP

I already installed it before using asdf…

Anyway, I install it again, and try mix phx.new …

mindok

mindok

What’s your OS out of interest?

jejuro

jejuro OP

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

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews