Skip to content

RollupError: You have declared using "external" babelHelpers, but transforming index.js resulted in "inline". #1539

Closed

Description

@JinHe-PerkinElmer
  • Rollup Plugin Name: @rollup/plugin-babel
  • Rollup Plugin Version: "^6.0.3"
  • Rollup Version: "^3.26.3"
  • Operating System (or Browser): Win10 - Google Chrome Version 114.0.5735.199
  • Node Version: v14.21.3
  • Link to reproduction (⚠️ read below):

Expected Behavior

Solve the error about "external" babelHelpers and build successful.

Actual Behavior

[!] (plugin commonjs--resolver) RollupError: You have declared using "external" babelHelpers, but transforming C:\Documents\GitHub\OneSource-Web-CommonLib\React\index.js resulted in "inline". Please check your configuration.

Additional Information

Background: We used "rollup": "^0.64.1" before, Now to do technical upgrades, I upgrade rollup to the latest version v3, also update babels and plugins. But now meet this error. Can some one help this?

Here is the rollup.config:

import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import url from '@rollup/plugin-url';
import svgr from '@svgr/rollup';

import pkg from './package.json';

{
  input: 'index.js',
  output: [
    {
      file: pkg.main,
      format: 'cjs',
      sourcemap: true,
    },
    {
      file: pkg.module,
      format: 'es',
      sourcemap: true,
    },
  ],
  plugins: [
    external(),
    postcss({
      extract: 'dist/os-common.css',
    }),
    url(),
    svgr(),
    commonjs(),
    babel({
      exclude: 'node_modules/**',
      babelHelpers: 'external',
    }),
    nodeResolve(),
  ],
}

Activity

  1. locked and limited conversation to collaborators on Jul 20, 2023
  2. converted this issue into a discussion #1540 on Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions