Object is not a function error using v7.13.x

Bug Report



Current behavior

my package.json using babel v6,while some package like react-redux using babel ^7.1.1.
babel v6 comile v7.13.x to image above,i think thatis the question

- Babel version(s): [package.json v6 ,error package v7.13.x]
- Node/npm version: [v12]
- OS: [macos]
- How you are using Babel: [`webpack`]

2 thoughts on “Object is not a function error using v7.13.x

  1. @LeventLei This is a bug in af-webpack (a dependency of roadhog): it tells webpack “If an extension is not one of html|ejs|json|js|jsx|ts|tsx|css|less|scss|sass, load it as a string URL instead of executing it”. Webpack’s default behavior would be to load .mjs files as JavaScript, but af-webpack prevents it from doing so.

    As a workaround, you can add urlLoaderExcludes: [/\.mjs$/, /\.cjs$/], to your .webpackrc.js config (I also added .cjs because it’s another JS extension that af-webpack doesn’t handle correctly, even if it’s not related to the current error), but I strongly suggest reporting this bug to af-webpack so that they can fix it.