Giter VIP home page Giter VIP logo

Comments (4)

nicolo-ribaudo avatar nicolo-ribaudo commented on July 20, 2024 2

This happens because you had the syntax-dynamic-import plugin duplicated (once in the preset and once explicitly in your config).

If anyone wants to look at this issue, it's because we "eject" the stage presets by replacing them with the plugins that they enable, without checking if those plugins are already there.

from babel-upgrade.

nicolo-ribaudo avatar nicolo-ribaudo commented on July 20, 2024

What was your full original .babelrc?

from babel-upgrade.

tpai avatar tpai commented on July 20, 2024

Here it is.

{
  'presets': [
    ['env', {
      "targets": {
        "browsers": ["ie >= 11"]
      },
      "modules": false
    }],
    'stage-0',
    'react'
  ],
  'plugins': [
    'syntax-dynamic-import'
  ]
}

from babel-upgrade.

claytonrcarter avatar claytonrcarter commented on July 20, 2024

Not sure if this is the same issue, but I just ran npx babel-upgrade --write --install and almost everything worked fine, except for the following:

input

...
      "presets": [
      [
        "es2015",
        {
          "modules": false
        }
      ],
      [
        "env",
        {
          "modules": false
        }
      ]
    ],
...

output

...
    "presets": [
      [
        "@babel/preset-env",
        {
          "modules": false
        }
      ],
      [
        "@babel/preset-env",
        {
          "modules": false
        }
      ]
    ],
...

As I ponder it, it may be that the input was suboptimal (Babel & the various stage configs sometimes seems like black magic to me), but it worked, and afterward, it didn't. Removing the duplicate entry fixed the problem and everything started working again.

Thank you for this utility! I spent 4 hours trying to upgrade manually this morning w/ no luck. I started over and, aside from this hiccup, this utility did the job in a few minutes.

from babel-upgrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.