Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformer-babel error: Unknown option: .showIgnoredFiles (Nightly 598) #5879

Closed
ittaibaratz opened this issue Feb 18, 2021 · 10 comments
Closed

Comments

@ittaibaratz
Copy link
Contributor

ittaibaratz commented Feb 18, 2021

🐛 bug report

With nightly 598, our build fails right away on the following error:

@parcel/transformer-babel: Unknown option: .showIgnoredFiles. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options. auxiliaryComment,blacklist,breakConfig,experimental,externalHelpers,extra,jsxPragma,loose,metadataUsedHelpers,modules,nonStandard,optional,sourceMapName,stage,whitelist,resolveModuleSource,metadata,sourceMapTarget
Error: Unknown option: .showIgnoredFiles. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options. auxiliaryComment,blacklist,breakConfig,experimental,externalHelpers,extra,jsxPragma,loose,metadataUsedHelpers,modules,nonStandard,optional,sourceMapName,stage,whitelist,resolveModuleSource,metadata,sourceMapTarget
    at throwUnknownError (/Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/validation/options.js:123:27)
    at /Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/validation/options.js:108:5
    at Array.forEach (<anonymous>)
    at validateNested (/Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/validation/options.js:84:21)
    at validate (/Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/validation/options.js:75:10)
    at loadPrivatePartialConfig (/Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/partial.js:76:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Object.<anonymous> (/Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/lib/config/partial.js:120:25)
    at Generator.next (<anonymous>)
    at step (/Users/ittai/Documents/GitHub/unified-shell/node_modules/gensync/index.js:254:32)

Not sure where the error is coming from, but I can see shoeIgnoredFiles on the Babel website. Note this issue was not happening with Nightly 577 where we could build fine.

Also, prior to this issue, I ran into #5854 (Which also did not happen with nightly 577) and so I added these packages in the monorepo root package.json to overcome and disabled auto install:

    "@parcel/transformer-posthtml": "^2.0.0-nightly.600",
    "@parcel/transformer-html": "^2.0.0-nightly.600",
    "@parcel/packager-html": "^2.0.0-nightly.600"

Also tried adding @parcel/transformer-babel but it didn't make a difference.

🎛 Configuration (.babelrc, package.json, cli command)

Babel:

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

  return {
    presets: [
      [
        '@babel/preset-env',
        {
          bugfixes: true,
          corejs: 2,
          useBuiltIns: 'entry'
        }
      ],
      '@babel/preset-react',
      '@babel/preset-typescript'
    ],
    plugins: [
      '@babel/plugin-proposal-class-properties',
      ["@babel/plugin-proposal-decorators", {decoratorsBeforeExport: true}]
    ]
  }
};

🤔 Expected Behavior

Build should be successful.

😯 Current Behavior

Build fails almost immediatelly.

💁 Possible Solution

🔦 Context

💻 Code Sample

I can provide access to @devongovett (Same company). Can also try to do a minimal reproduction if required.

🌍 Your Environment

Software Version(s)
Parcel 2.0.0 nightly 598
Node 14/15 (latest)
npm/Yarn latest
Operating System CentOS / Mac OS
@mischnic
Copy link
Member

mischnic commented Feb 18, 2021

The flag showIgnoredFiles was set as part of #5769.

It was added in @babel/core v7.12.0. I'd say you're using an older version somehow?

@devongovett This is another case of the babel transformer not having a hard dependency on babel core. Otherwise there would have been ^7.12.0:

"@babel/core": "^7.12.0"

@ittaibaratz
Copy link
Contributor Author

@mischnic this goes beyond my Babel knowledge .. We are using @babel/core, however we are also using Testcafe for integration tests which imports babel-core 6:

From our yarn.lock:

"@babel/core@^7.1.0", "@babel/core@^7.12.13", "@babel/core@^7.12.3", "@babel/core@^7.4.4", "@babel/core@^7.7.5":
  version "7.12.13"

babel-core@^6.22.1, babel-core@^6.26.0:
  version "6.26.3"

Should we add babel-core as a dev dependency to resolve this? Will try.

@mischnic
Copy link
Member

mischnic commented Feb 18, 2021

Sorry, I meant @babel/core, not babel-core

What version is installed at /Users/ittai/Documents/GitHub/unified-shell/node_modules/@parcel/transformer-babel/node_modules/@babel/core/package.json ?

@devongovett
Copy link
Member

That should cause yarn/npm to give incompatible peer dep warnings which is the best we can do I think

@ittaibaratz
Copy link
Contributor Author

ittaibaratz commented Feb 18, 2021

@mischnic 7.10.4 - I don't see it in yarn.lock though, I'll try to do a clean install.

@ittaibaratz
Copy link
Contributor Author

ittaibaratz commented Feb 18, 2021

Ok, a clean install solved. Closing. Thanks for the quick reply!

@aminya
Copy link
Contributor

aminya commented Mar 31, 2021

I have this issue in
atom-community/babel-preset-atomic#9

> cross-env NODE_ENV=production parcel build --target main index.js

× Build failed.
@parcel/transformer-babel: Unknown option: .showIgnoredFiles. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
Error: Unknown option: .showIgnoredFiles. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at throwUnknownError (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\validation\options.js:124:27)
    at C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\validation\options.js:109:5
    at Array.forEach (<anonymous>)
    at validateNested (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\validation\options.js:85:21)
    at validate (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\validation\options.js:76:10)
    at loadPrivatePartialConfig (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\partial.js:76:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Object.<anonymous> (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\@babel\[email protected]\node_modules\@babel\core\lib\config\partial.js:125:25)
    at Generator.next (<anonymous>)
    at step (C:\Users\aminy\Documents\GitHub\JavaScript\@atom-ide-community\babel\node_modules\.pnpm\[email protected]\node_modules\gensync\index.js:254:32)
 ERROR  Command failed with exit code 1.

@mischnic
Copy link
Member

It was added in @babel/core v7.12.0. I'd say you're using an older version somehow?

Your package.json:

"devDependencies": {
   "@babel/cli": "7.11.6",
   "@babel/core": "7.11.6",

@aminya
Copy link
Contributor

aminya commented Mar 31, 2021

That's strange. npm-check-updates doesn't suggest me @babel/core 7.12.0. I thought my deps are up-to-date.

cc: @raineorshine

@raineorshine
Copy link

That's strange. npm-check-updates doesn't suggest me @babel/core 7.12.0. I thought my deps are up-to-date.

cc: @raineorshine

npm-check-updates correctly suggests the latest:

$ ncu
Checking ... package.json
[====================] 2/2 100%

 @babel/cli   7.11.6  →  7.13.14
 @babel/core  7.11.6  →  7.13.14
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants