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

You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type #15765

Closed
1 task
nagasundram opened this issue Jul 7, 2023 · 46 comments · Fixed by #15771
Closed
1 task
Labels
i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@nagasundram
Copy link

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

...

Configuration file name

No response

Configuration

No response

Current and expected behavior

After upgrading to 7.22.8 this issue is coming

Environment

  • Babel version 7.22.8

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @nagasundram! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@JLHwung
Copy link
Contributor

JLHwung commented Jul 7, 2023

Can you attach the output of npm ls @babel/types?

@nagasundram
Copy link
Author

nagasundram commented Jul 7, 2023

@JLHwung

├─┬ @babel/traverse@7.22.1
│ ├─┬ @babel/generator@7.22.7
│ │ └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/helper-function-name@7.22.5
│ │ ├─┬ @babel/template@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/helper-hoist-variables@7.22.5
│ │ └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/helper-split-export-declaration@7.22.6
│ │ └── @babel/types@7.22.5  deduped
│ └── @babel/types@7.22.5 
.....

@JLHwung
Copy link
Contributor

JLHwung commented Jul 7, 2023

Please attach the whole input, they are important. The ClassAccessorProperty is a relatively new AST type, for this error there must be a @babel/traverse instance that is depending on an old version of @babel/types which does not support ClassAccessorProperty.

@nagasundram
Copy link
Author

Can you please share the older version which does not support ClassAccessorProperty @JLHwung?
Can we expect any patch fix for this issue?

@JLHwung
Copy link
Contributor

JLHwung commented Jul 7, 2023

ClassAccessorProperty was introduced in v7.17.0, please check your node_modules if there are @babel/types < 7.17.0 and update them.

Can we expect any patch fix for this issue?

We are still triaging this issue. If it comes from an official Babel plugin, it will be fixed. If you want to prioritize this issue, please provide a reproduction repo.

@nagasundram
Copy link
Author

@JLHwung this issues is happening only after auto upgrade of @babel/traverse 7.22.8. (dependency package of some libraires) so if we downgrade the @babel/traverse version will it solve this issue.

@nagasundram
Copy link
Author

@JLHwung Please refer one of the repo affected because of this error

Error: ember-composable-helpers/helpers/sort-by.js: /app/ember-composable-helpers/helpers/sort-by.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

        in /tmp/broccoli-1pg25iGVyrxMP/out-564-funnel_funnel_ember_composable_helpers_addon

        at broccoli-persistent-filter:Babel > [Babel: ember-composable-helpers] (Babel: ember-composable-helpers)

Error: /app/ember-composable-helpers/helpers/sort-by.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

    at verify (/app/node_modules/@babel/traverse/lib/visitors.js:112:13)

    at Object.explode (/app/node_modules/@babel/traverse/lib/visitors.js:34:3)

    at traverse (/app/node_modules/@babel/traverse/lib/index.js:63:12)

    at NodePath.traverse (/app/node_modules/@babel/traverse/lib/path/index.js:142:24)

    at ReplaceSupers.replace (/app/node_modules/ember-composable-helpers/node_modules/@babel/helper-replace-supers/lib/index.js:214:23)

    at pushBody (/app/node_modules/ember-composable-helpers/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:128:23)

    at buildBody (/app/node_modules/ember-composable-helpers/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:94:5)

    at classTransformer (/app/node_modules/ember-composable-helpers/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:475:5)

    at transformClass (/app/node_modules/ember-composable-helpers/node_modules/@babel/plugin-transform-classes/lib/transformClass.js:505:10)

    at PluginPass.ClassExpression (/app/node_modules/ember-composable-helpers/node_modules/@babel/plugin-transform-classes/lib/index.js:54:77)Pipeline aborted

@JLHwung
Copy link
Contributor

JLHwung commented Jul 7, 2023

/app/node_modules/ember-composable-helpers/node_modules/@babel/helper-replace-supers/lib/index.js:214:23

The @babel/helper-replace-supers is not hoisted to the top level, can you update all the @babel/* in ember-composable-helpers?

@nagasundram
Copy link
Author

@JLHwung ember-composable-helpers is not maintained by us, also this issue is happening with multiple libraries that has babel dependency.

Any possible fix version can we expect?

@JLHwung
Copy link
Contributor

JLHwung commented Jul 7, 2023

ember-composable-helpers does not pin @babel/* versions, which means if you delete the lock file and do a fresh install again, it should work because all @babel/* dependencies are then updated to the latest version.

Can you share the lock file? Unfortunately without the reproduction dependency maps, we can not know what is going wrong here.

@Cessilva
Copy link

Cessilva commented Jul 11, 2023

I have the same issue, I deleted my package -lock.js and my node modules, it happens the same error, I'm actually update my babel/types to 7.17.0 , but it doesn't work, it seems what napat-u said was correct, but I don't find how to solve it. Some one ,has any idea?

@JLHwung
Copy link
Contributor

JLHwung commented Jul 11, 2023

@Cessilva please provide a reproduction repo if you want this issue to be prioritized. Unfortunately it is very hard to reproduce compatibility issues like that without such repo, otherwise it would have been caught by our CI.

@nagasundram
Copy link
Author

@JLHwung https://github.com/knownasilya/ember-toggle/tree/v7.1.1 please check this package at v7.1.1
from this package getting
ember-gesture-modifiers/modifiers/did-pan.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

@JLHwung
Copy link
Contributor

JLHwung commented Jul 11, 2023

@nagasundram Can you print the top level @babel/traverse and @babel/types version?

cat ./node_modules/@babel/traverse/package.json | grep version
cat ./node_modules/@babel/types/package.json | grep version

@JLHwung
Copy link
Contributor

JLHwung commented Jul 11, 2023

@nagasundram @Cessilva I have posted some speculation about this issue on #15771 as I can't confirm because we don't have a reproduction repo. Let me know if that is exactly the case. You can fix this issue without waiting for a patch.

@johnny-washswat
Copy link

We are also facing similar issue
./node_modules/next/dist/client/index.js Error: /app/node_modules/next/dist/client/index.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

"@babel/core": "^7.14.0",

Is there any solution?
It is really urgent pls

@SouthLink
Copy link

SouthLink commented Jul 12, 2023

Failed to compile.
./pages/_app.js
Error: /www/pages/_app.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type
> Build error occurred
Error: > Build failed because of webpack errors
    at /www/node_modules/.pnpm/next@10.0.9_ud7k66ugorzstbqxe6n5tclhe4/node_modules/next/dist/build/index.js:15:918
    at async Span.traceAsyncFn (/www/node_modules/.pnpm/next@10.0.9_ud7k66ugorzstbqxe6n5tclhe4/node_modules/next/dist/telemetry/trace/trace.js:5:584)
 ELIFECYCLE  Command failed with exit code 1.

I also have this problem on my side, and the gitlab-cli build has been failing since today.

The local pnpm version was found to be inconsistent with the pnpm version of the builder. The pnpm version of the builder was upgraded to resolve the problem

@nicolo-ribaudo
Copy link
Member

If anyone can share a repository that shows the error, that would be really helpful for us to be sure about what's going on.

@johnny-washswat
Copy link

johnny-washswat commented Jul 12, 2023

for us This was an issue

├─┬ next@11.1.4
│ └─┬ styled-jsx@4.0.1
│   └── @babel/types@7.15.0

@mfraigneau
Copy link

Same error here since few days.
I can't share the repository but i can share the result of npm ls @babel/types :

├─┬ @babel/core@7.2.2
│ ├─┬ @babel/generator@7.13.16
│ │ └── @babel/types@7.13.16 deduped
│ ├─┬ @babel/helpers@7.13.16
│ │ └── @babel/types@7.13.16 deduped
│ ├─┬ @babel/template@7.12.13
│ │ └── @babel/types@7.13.16 deduped
│ ├─┬ @babel/traverse@7.13.15
│ │ ├─┬ @babel/helper-function-name@7.12.13
│ │ │ ├─┬ @babel/helper-get-function-arity@7.12.13
│ │ │ │ └── @babel/types@7.13.16 deduped
│ │ │ └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/helper-split-export-declaration@7.12.13
│ │ │ └── @babel/types@7.13.16 deduped
│ │ └── @babel/types@7.13.16 deduped
│ └── @babel/types@7.13.16
├─┬ @babel/plugin-proposal-class-properties@7.18.6
│ └─┬ @babel/helper-create-class-features-plugin@7.22.6
│   ├─┬ @babel/helper-annotate-as-pure@7.22.5
│   │ └── @babel/types@7.22.5
│   ├─┬ @babel/helper-function-name@7.22.5
│   │ ├─┬ @babel/template@7.22.5
│   │ │ └── @babel/types@7.22.5 deduped
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-member-expression-to-functions@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-optimise-call-expression@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-replace-supers@7.22.5
│   │ ├─┬ @babel/traverse@7.22.8
│   │ │ ├─┬ @babel/generator@7.22.7
│   │ │ │ └── @babel/types@7.22.5 deduped
│   │ │ ├─┬ @babel/helper-hoist-variables@7.22.5
│   │ │ │ └── @babel/types@7.22.5 deduped
│   │ │ └── @babel/types@7.22.5 deduped
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-skip-transparent-expression-wrappers@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   └─┬ @babel/helper-split-export-declaration@7.22.6
│     └── @babel/types@7.22.5 deduped
├─┬ @svgr/webpack@4.1.0
│ ├─┬ @babel/core@7.13.16
│ │ ├─┬ @babel/helper-module-transforms@7.13.14
│ │ │ ├─┬ @babel/helper-simple-access@7.13.12
│ │ │ │ └── @babel/types@7.13.16 deduped
│ │ │ └── @babel/types@7.13.16 deduped
│ │ └── @babel/types@7.13.16 deduped
│ ├─┬ @babel/preset-env@7.13.15
│ │ ├─┬ @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12
│ │ │ └─┬ @babel/helper-skip-transparent-expression-wrappers@7.12.1
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-proposal-async-generator-functions@7.13.15
│ │ │ └─┬ @babel/helper-remap-async-to-generator@7.13.0
│ │ │   ├─┬ @babel/helper-wrap-function@7.13.0
│ │ │   │ └── @babel/types@7.13.16 deduped
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-proposal-object-rest-spread@7.13.8
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-syntax-async-generators@7.8.4
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-syntax-dynamic-import@7.8.3
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-syntax-json-strings@7.8.3
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-syntax-object-rest-spread@7.8.3
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-syntax-optional-catch-binding@7.8.3
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-classes@7.13.0
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-destructuring@7.13.0
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-exponentiation-operator@7.12.13
│ │ │ └─┬ @babel/helper-builder-binary-assignment-operator-visitor@7.12.13
│ │ │   ├─┬ @babel/helper-explode-assignable-expression@7.13.0
│ │ │   │ └── @babel/types@7.13.16 deduped
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-modules-systemjs@7.13.8
│ │ │ └─┬ @babel/helper-hoist-variables@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-new-target@7.12.13
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/plugin-transform-regenerator@7.13.15
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ ├─┬ @babel/preset-modules@0.1.4
│ │ │ └── @babel/types@7.13.16 deduped
│ │ └── @babel/types@7.13.16 deduped
│ ├─┬ @babel/preset-react@7.13.13
│ │ ├─┬ @babel/plugin-transform-react-display-name@7.12.13
│ │ │ └─┬ @babel/core@7.13.16
│ │ │   └── @babel/types@7.13.16 deduped
│ │ └─┬ @babel/plugin-transform-react-jsx@7.13.12
│ │   ├─┬ @babel/core@7.13.16
│ │   │ └── @babel/types@7.13.16 deduped
│ │   └── @babel/types@7.13.16 deduped
│ └─┬ @svgr/plugin-jsx@4.3.3
│   ├─┬ @babel/core@7.13.16
│   │ └── @babel/types@7.13.16 deduped
│   └─┬ @svgr/hast-util-to-babel-ast@4.3.2
│     └── @babel/types@7.13.16 deduped
├─┬ babel-eslint@9.0.0
│ └── @babel/types@7.13.16 deduped
└─┬ babel-preset-react-app@7.0.2
  ├─┬ @babel/plugin-proposal-class-properties@7.3.0
  │ └─┬ @babel/helper-create-class-features-plugin@7.13.11
  │   └─┬ @babel/helper-member-expression-to-functions@7.13.12
  │     └── @babel/types@7.13.16 deduped
  ├─┬ @babel/plugin-transform-classes@7.2.2
  │ ├─┬ @babel/helper-annotate-as-pure@7.12.13
  │ │ └── @babel/types@7.13.16 deduped
  │ ├─┬ @babel/helper-define-map@7.13.12
  │ │ └── @babel/types@7.13.16 deduped
  │ ├─┬ @babel/helper-optimise-call-expression@7.12.13
  │ │ └── @babel/types@7.13.16 deduped
  │ └─┬ @babel/helper-replace-supers@7.13.12
  │   └── @babel/types@7.13.16 deduped
  ├─┬ @babel/plugin-transform-runtime@7.2.0
  │ └─┬ @babel/helper-module-imports@7.13.12
  │   └── @babel/types@7.13.16 deduped
  └─┬ @babel/preset-env@7.3.1
    ├─┬ @babel/plugin-proposal-async-generator-functions@7.13.15
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-proposal-json-strings@7.13.8
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-proposal-optional-catch-binding@7.13.8
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-proposal-unicode-property-regex@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-arrow-functions@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-async-to-generator@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-block-scoped-functions@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-block-scoping@7.13.16
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-computed-properties@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-dotall-regex@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-duplicate-keys@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-exponentiation-operator@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-for-of@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-function-name@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-literals@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-modules-amd@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-modules-commonjs@7.13.8
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-modules-systemjs@7.13.8
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-modules-umd@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-named-capturing-groups-regex@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-object-super@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-parameters@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-shorthand-properties@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-spread@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-sticky-regex@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-template-literals@7.13.0
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    ├─┬ @babel/plugin-transform-typeof-symbol@7.12.13
    │ └─┬ @babel/core@7.13.16
    │   └── @babel/types@7.13.16 deduped
    └─┬ @babel/plugin-transform-unicode-regex@7.12.13
      └─┬ @babel/core@7.13.16
        └── @babel/types@7.13.16 deduped

@aatishbarnwal
Copy link

Exactly Same issue am facing while running 'yarn start'
/node_modules/@reach/router/es/lib/history.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type at Array.forEach ()

It was working with node version 14, but when we upgraded node version to 18.15.0 , it started throwing error.

Any help or pointers would be appreciated

@saul-prepared
Copy link

I am facing the same issue but with capacitor

Error: /opt/build/repo/node_modules/@capacitor/app/dist/esm/web.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

Any help would be appreciated.

@7orry
Copy link

7orry commented Jul 12, 2023

Same error here
You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type

 next@10.2.3
  └─┬ styled-jsx@3.3.2
    └── @babel/types@7.8.3

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jul 12, 2023

Can someone share a repository please? 🙏

@aatishbarnwal
Copy link

aatishbarnwal commented Jul 12, 2023

I can't share the repository but i can share the result of npm ls @babel/types :

├─┬ @babel/plugin-proposal-private-property-in-object@7.21.11
│ ├─┬ @babel/core@7.22.8
│ │ ├─┬ @babel/generator@7.22.7
│ │ │ └── @babel/types@7.22.5 deduped
│ │ ├─┬ @babel/helper-module-transforms@7.22.5
│ │ │ ├─┬ @babel/helper-module-imports@7.22.5
│ │ │ │ └── @babel/types@7.22.5 deduped
│ │ │ ├─┬ @babel/helper-simple-access@7.22.5
│ │ │ │ └── @babel/types@7.22.5 deduped
│ │ │ └── @babel/types@7.22.5 deduped
│ │ ├─┬ @babel/helpers@7.22.6
│ │ │ └── @babel/types@7.22.5 deduped
│ │ ├─┬ @babel/template@7.22.5
│ │ │ └── @babel/types@7.22.5 deduped
│ │ ├─┬ @babel/traverse@7.22.8
│ │ │ ├─┬ @babel/generator@7.22.7
│ │ │ │ └── @babel/types@7.22.5 deduped
│ │ │ ├─┬ @babel/helper-hoist-variables@7.22.5
│ │ │ │ └── @babel/types@7.22.5 deduped
│ │ │ └── @babel/types@7.22.5 deduped
│ │ └── @babel/types@7.22.5 deduped
│ ├─┬ @babel/helper-annotate-as-pure@7.22.5
│ │ └── @babel/types@7.22.5 deduped
│ └─┬ @babel/helper-create-class-features-plugin@7.22.6
│   ├─┬ @babel/helper-function-name@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-member-expression-to-functions@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-optimise-call-expression@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-replace-supers@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   ├─┬ @babel/helper-skip-transparent-expression-wrappers@7.22.5
│   │ └── @babel/types@7.22.5 deduped
│   └─┬ @babel/helper-split-export-declaration@7.22.6
│     └── @babel/types@7.22.5 deduped
├── @babel/types@7.22.5
├─┬ babel-eslint@10.1.0
│ ├─┬ @babel/traverse@7.12.5
│ │ ├─┬ @babel/generator@7.12.5
│ │ │ └── @babel/types@7.12.6
│ │ ├─┬ @babel/helper-function-name@7.10.4
│ │ │ ├─┬ @babel/helper-get-function-arity@7.10.4
│ │ │ │ └── @babel/types@7.12.6
│ │ │ ├─┬ @babel/template@7.10.4
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ └── @babel/types@7.12.6 deduped
│ │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │ │ └── @babel/types@7.12.6 deduped
│ │ └── @babel/types@7.12.6 deduped
│ └── @babel/types@7.12.6
├─┬ react-scripts@4.0.0
│ ├─┬ @babel/core@7.12.3
│ │ ├─┬ @babel/helper-module-transforms@7.12.1
│ │ │ ├─┬ @babel/helper-module-imports@7.12.5
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ ├─┬ @babel/helper-replace-supers@7.12.5
│ │ │ │ ├─┬ @babel/helper-member-expression-to-functions@7.12.1
│ │ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ │ ├─┬ @babel/helper-optimise-call-expression@7.10.4
│ │ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ ├─┬ @babel/helper-simple-access@7.12.1
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ └── @babel/types@7.12.6 deduped
│ │ ├─┬ @babel/helpers@7.12.5
│ │ │ └── @babel/types@7.12.6 deduped
│ │ ├─┬ @babel/template@7.10.4
│ │ │ └── @babel/types@7.12.6 deduped
│ │ ├─┬ @babel/traverse@7.12.5
│ │ │ ├─┬ @babel/helper-function-name@7.10.4
│ │ │ │ └── @babel/types@7.12.6 deduped
│ │ │ └── @babel/types@7.12.6 deduped
│ │ └── @babel/types@7.12.6
│ ├─┬ @svgr/webpack@5.4.0
│ │ ├─┬ @babel/preset-env@7.22.7
│ │ │ ├─┬ @babel/plugin-transform-async-generator-functions@7.22.7
│ │ │ │ └─┬ @babel/helper-remap-async-to-generator@7.22.5
│ │ │ │   ├─┬ @babel/helper-wrap-function@7.22.5
│ │ │ │   │ └── @babel/types@7.22.5 deduped
│ │ │ │   └── @babel/types@7.22.5 deduped
│ │ │ ├─┬ @babel/plugin-transform-exponentiation-operator@7.22.5
│ │ │ │ └─┬ @babel/helper-builder-binary-assignment-operator-visitor@7.22.5
│ │ │ │   └── @babel/types@7.22.5 deduped
│ │ │ ├─┬ @babel/preset-modules@0.1.5
│ │ │ │ ├─┬ @babel/plugin-proposal-unicode-property-regex@7.12.1
│ │ │ │ │ └─┬ @babel/helper-create-regexp-features-plugin@7.12.1
│ │ │ │ │   └─┬ @babel/helper-annotate-as-pure@7.10.4
│ │ │ │ │     └── @babel/types@7.12.6
│ │ │ │ ├─┬ @babel/plugin-transform-dotall-regex@7.12.1
│ │ │ │ │ └─┬ @babel/helper-create-regexp-features-plugin@7.12.1
│ │ │ │ │   └─┬ @babel/helper-annotate-as-pure@7.10.4
│ │ │ │ │     └── @babel/types@7.12.6 deduped
│ │ │ │ └── @babel/types@7.12.6
│ │ │ └── @babel/types@7.22.5 deduped
│ │ ├─┬ @babel/preset-react@7.22.5
│ │ │ └─┬ @babel/plugin-transform-react-jsx@7.22.5
│ │ │   └── @babel/types@7.22.5 deduped
│ │ └─┬ @svgr/plugin-jsx@5.5.0
│ │   ├─┬ @babel/core@7.12.3
│ │   │ ├─┬ @babel/helper-module-transforms@7.12.1
│ │   │ │ ├─┬ @babel/helper-module-imports@7.12.5
│ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ ├─┬ @babel/helper-replace-supers@7.12.5
│ │   │ │ │ ├─┬ @babel/helper-member-expression-to-functions@7.12.1
│ │   │ │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ │ ├─┬ @babel/helper-optimise-call-expression@7.10.4
│ │   │ │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ ├─┬ @babel/helper-simple-access@7.12.1
│ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ └── @babel/types@7.12.6 deduped
│ │   │ ├─┬ @babel/helpers@7.12.5
│ │   │ │ └── @babel/types@7.12.6 deduped
│ │   │ ├─┬ @babel/template@7.10.4
│ │   │ │ └── @babel/types@7.12.6 deduped
│ │   │ ├─┬ @babel/traverse@7.12.5
│ │   │ │ ├─┬ @babel/helper-function-name@7.10.4
│ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │   │ │ └── @babel/types@7.12.6 deduped
│ │   │ └── @babel/types@7.12.6
│ │   └─┬ @svgr/hast-util-to-babel-ast@5.5.0
│ │     └── @babel/types@7.12.6
│ ├─┬ babel-jest@26.6.3
│ │ ├─┬ @jest/transform@26.6.2
│ │ │ └─┬ @babel/core@7.12.3
│ │ │   ├─┬ @babel/helper-module-transforms@7.12.1
│ │ │   │ ├─┬ @babel/helper-module-imports@7.12.5
│ │ │   │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ ├─┬ @babel/helper-replace-supers@7.12.5
│ │ │   │ │ ├─┬ @babel/helper-member-expression-to-functions@7.12.1
│ │ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ │ ├─┬ @babel/helper-optimise-call-expression@7.10.4
│ │ │   │ │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ ├─┬ @babel/helper-simple-access@7.12.1
│ │ │   │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │ │   │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ └── @babel/types@7.12.6 deduped
│ │ │   ├─┬ @babel/helpers@7.12.5
│ │ │   │ └── @babel/types@7.12.6 deduped
│ │ │   ├─┬ @babel/template@7.10.4
│ │ │   │ └── @babel/types@7.12.6 deduped
│ │ │   ├─┬ @babel/traverse@7.12.5
│ │ │   │ ├─┬ @babel/helper-function-name@7.10.4
│ │ │   │ │ └── @babel/types@7.12.6 deduped
│ │ │   │ └── @babel/types@7.12.6 deduped
│ │ │   └── @babel/types@7.12.6
│ │ ├─┬ @types/babel__core@7.20.1
│ │ │ ├── @babel/types@7.22.5 deduped
│ │ │ ├─┬ @types/babel__generator@7.6.2
│ │ │ │ └── @babel/types@7.12.6
│ │ │ └─┬ @types/babel__template@7.4.0
│ │ │   └── @babel/types@7.12.6
│ │ ├─┬ babel-plugin-istanbul@6.1.1
│ │ │ └─┬ istanbul-lib-instrument@5.2.1
│ │ │   └─┬ @babel/core@7.12.3
│ │ │     ├─┬ @babel/helper-module-transforms@7.12.1
│ │ │     │ ├─┬ @babel/helper-module-imports@7.12.5
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-replace-supers@7.12.5
│ │ │     │ │ ├─┬ @babel/helper-member-expression-to-functions@7.12.1
│ │ │     │ │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ │ ├─┬ @babel/helper-optimise-call-expression@7.10.4
│ │ │     │ │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-simple-access@7.12.1
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/helpers@7.12.5
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/template@7.10.4
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/traverse@7.12.5
│ │ │     │ ├─┬ @babel/helper-function-name@7.10.4
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     └── @babel/types@7.12.6
│ │ └─┬ babel-preset-jest@26.6.2
│ │   └─┬ babel-plugin-jest-hoist@26.6.2
│ │     ├─┬ @babel/template@7.10.4
│ │     │ └── @babel/types@7.12.6 deduped
│ │     ├── @babel/types@7.12.6
│ │     └─┬ @types/babel__core@7.1.12
│ │       └── @babel/types@7.12.6 deduped
│ ├─┬ jest-circus@26.6.0
│ │ ├─┬ @types/babel__traverse@7.0.15
│ │ │ └── @babel/types@7.12.6
│ │ ├─┬ jest-runner@26.6.3
│ │ │ └─┬ jest-config@26.6.3
│ │ │   └─┬ @babel/core@7.12.3
│ │ │     ├─┬ @babel/helper-module-transforms@7.12.1
│ │ │     │ ├─┬ @babel/helper-module-imports@7.12.5
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-replace-supers@7.12.5
│ │ │     │ │ ├─┬ @babel/helper-member-expression-to-functions@7.12.1
│ │ │     │ │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ │ ├─┬ @babel/helper-optimise-call-expression@7.10.4
│ │ │     │ │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-simple-access@7.12.1
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ ├─┬ @babel/helper-split-export-declaration@7.11.0
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/helpers@7.12.5
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/template@7.10.4
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     ├─┬ @babel/traverse@7.12.5
│ │ │     │ ├─┬ @babel/helper-function-name@7.10.4
│ │ │     │ │ └── @babel/types@7.12.6 deduped
│ │ │     │ └── @babel/types@7.12.6 deduped
│ │ │     └── @babel/types@7.12.6
│ │ └─┬ jest-snapshot@26.6.2
│ │   └── @babel/types@7.12.6
│ └─┬ workbox-webpack-plugin@5.1.4
│   └─┬ workbox-build@5.1.4
│     └─┬ rollup-plugin-babel@4.4.0
│       └─┬ @babel/helper-module-imports@7.12.5
│         └── @babel/types@7.12.6
└─┬ styled-components@5.3.5 
  ├─┬ @babel/helper-module-imports@7.12.5
  │ └── @babel/types@7.12.6
  ├─┬ @babel/traverse@7.12.5
  │ ├─┬ @babel/helper-function-name@7.10.4
  │ │ ├─┬ @babel/template@7.10.4
  │ │ │ └── @babel/types@7.12.6 deduped
  │ │ └── @babel/types@7.12.6 deduped
  │ ├─┬ @babel/helper-split-export-declaration@7.11.0
  │ │ └── @babel/types@7.12.6 deduped
  │ └── @babel/types@7.12.6 deduped
  └─┬ babel-plugin-styled-components@2.0.7
    ├─┬ @babel/helper-annotate-as-pure@7.16.7
    │ └── @babel/types@7.17.0
    └─┬ @babel/helper-module-imports@7.16.7
      └── @babel/types@7.17.0 deduped

@wunci
Copy link

wunci commented Jul 12, 2023

I'm encountering the same problem.
There were similar issues reported a long time ago at: storybookjs/storybook#12893 (comment).
I upgraded to version 7.22.5, and it seems to have fixed the problem.

@JLHwung
Copy link
Contributor

JLHwung commented Jul 12, 2023

For those affected by this issue, please upgrade to Babel 7.22.9:

  • Re-install @babel/core: npm uninstall @babel/core && npm install --save-dev @babel/core or Yarn equivalent commands. Doing so should update most @babel/* packages to latest versions
  • Run deduplication after the upgrade so that latest versions are picked by all libraries

@hereisfun
Copy link

For those affected by this issue, please upgrade to Babel 7.22.9:

  • Re-install @babel/core: npm uninstall @babel/core && npm install --save-dev @babel/core or Yarn equivalent commands. Doing so should update most @babel/* packages to latest versions

  • Run deduplication after the upgrade so that latest versions are picked by all libraries

Upgrading to Babel 7.22.9 solved my problem.

@aatishbarnwal
Copy link

Thanks @JLHwung for all your effort Unfortunately, it didn't help , post upgrading the @babel/core to 7.22.9 and running yarn dedupe, Still getting the same error.
Waiting to hear from others
@7orry ,@saul-prepared,@johnny-washswat,@nagasundram

@saul-prepared
Copy link

@JLHwung Thanks for getting onto this so quickly. Because mine was in a dependency I did not have to update any babel packages myself. Instead I ran npm install and then npm dedupe and then I was able to successfully build my application 👍

@johnny-washswat
Copy link

johnny-washswat commented Jul 13, 2023

Thanks @JLHwung for all your effort Unfortunately, it didn't help , post upgrading the @babel/core to 7.22.9 and running yarn dedupe, Still getting the same error. Waiting to hear from others @7orry ,@saul-prepared,@johnny-washswat,@nagasundram

We solved by doing this:

  1. Upgrading next version
  2. added babel/types inside package.json => resolutions

And my babel/core version was:
"@babel/core": "^7.14.0", but i did not update the version of babel core
Here:

  "next": "^12.3.4",
  "react": "18.2.0",
  "react-dom": "18.2.0",
  "resolutions": {
    "babel-loader": "8.0.6",
    "@babel/types": "7.22.5"
  }

DON'T forget doing:

rm -rf node_modules
npm i or yarn

@7orry
Copy link

7orry commented Jul 13, 2023

Thanks @JLHwung for all your effort Unfortunately, it didn't help , post upgrading the @babel/core to 7.22.9 and running yarn dedupe, Still getting the same error. Waiting to hear from others @7orry ,@saul-prepared,@johnny-washswat,@nagasundram

thank you guys for your efforts but upgrading to babel 7.22.9 still doesn't fix the issue on our side

@nicolo-ribaudo
Copy link
Member

@aatishbarnwal @7orry Can you share the output of npm ls @babel/types again? (or equivalent command for yarn/pnpm)

@7orry
Copy link

7orry commented Jul 13, 2023

@nicolo-ribaudo here is the output of npm ls @babel/types
this is before the update:

├─┬ @babel/core@7.22.0
│ ├─┬ @babel/generator@7.22.0
│ │ └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/helper-module-transforms@7.22.0
│ │ ├─┬ @babel/helper-simple-access@7.21.5
│ │ │ └── @babel/types@7.22.0  deduped
│ │ ├─┬ @babel/helper-split-export-declaration@7.18.6
│ │ │ └── @babel/types@7.22.0  deduped
│ │ └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/helpers@7.22.0
│ │ └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/template@7.21.9
│ │ └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/traverse@7.22.0
│ │ ├─┬ @babel/helper-function-name@7.21.0
│ │ │ └── @babel/types@7.22.0  deduped
│ │ ├─┬ @babel/helper-hoist-variables@7.18.6
│ │ │ └── @babel/types@7.22.0  deduped
│ │ └── @babel/types@7.22.0  deduped
│ └── @babel/types@7.22.0
├─┬ @babel/plugin-proposal-class-properties@7.18.6
│ └─┬ @babel/helper-create-class-features-plugin@7.22.0
│   ├─┬ @babel/helper-member-expression-to-functions@7.22.0
│   │ └── @babel/types@7.22.0  deduped
│   ├─┬ @babel/helper-optimise-call-expression@7.18.6
│   │ └── @babel/types@7.22.0  deduped
│   └─┬ @babel/helper-replace-supers@7.21.5
│     └── @babel/types@7.22.0  deduped
├─┬ @babel/plugin-proposal-optional-chaining@7.21.0
│ └─┬ @babel/helper-skip-transparent-expression-wrappers@7.20.0
│   └── @babel/types@7.22.0  deduped
├─┬ @babel/plugin-proposal-private-property-in-object@7.21.0
│ └─┬ @babel/helper-annotate-as-pure@7.18.6
│   └── @babel/types@7.22.0  deduped
├─┬ @babel/preset-env@7.22.0
│ ├─┬ @babel/plugin-transform-async-generator-functions@7.22.0
│ │ └─┬ @babel/helper-remap-async-to-generator@7.18.9
│ │   ├─┬ @babel/helper-wrap-function@7.20.5
│ │   │ └── @babel/types@7.22.0  deduped
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-exponentiation-operator@7.18.6
│ │ └─┬ @babel/helper-builder-binary-assignment-operator-visitor@7.22.0
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/preset-modules@0.1.5
│ │ └── @babel/types@7.22.0  deduped
│ └── @babel/types@7.22.0  deduped
├─┬ @babel/preset-react@7.22.0
│ └─┬ @babel/plugin-transform-react-jsx@7.22.0
│   └── @babel/types@7.22.0  deduped
├─┬ babel-plugin-styled-components@2.0.6
│ └─┬ @babel/helper-module-imports@7.21.4
│   └── @babel/types@7.22.0  deduped
├─┬ jest@27.5.1
│ └─┬ @jest/core@27.5.1
│   ├─┬ jest-config@27.5.1
│   │ └─┬ babel-jest@27.5.1
│   │   ├─┬ @types/babel__core@7.20.1
│   │   │ ├── @babel/types@7.22.0  deduped
│   │   │ ├─┬ @types/babel__generator@7.6.4
│   │   │ │ └── @babel/types@7.22.0  deduped
│   │   │ └─┬ @types/babel__template@7.4.1
│   │   │   └── @babel/types@7.22.0  deduped
│   │   └─┬ babel-preset-jest@27.5.1
│   │     └─┬ babel-plugin-jest-hoist@27.5.1
│   │       └── @babel/types@7.22.0  deduped
│   └─┬ jest-snapshot@27.5.1
│     ├── @babel/types@7.22.0  deduped
│     └─┬ @types/babel__traverse@7.20.0
│       └── @babel/types@7.22.0  deduped
└─┬ next@10.2.3
  └─┬ styled-jsx@3.3.2
    └── @babel/types@7.8.3

and this after the update to latest version

├─┬ @babel/core@7.22.9
│ ├─┬ @babel/generator@7.22.9
│ │ └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/helper-module-transforms@7.22.9
│ │ ├─┬ @babel/helper-module-imports@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ ├─┬ @babel/helper-simple-access@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ └─┬ @babel/helper-split-export-declaration@7.22.6
│ │   └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/helpers@7.22.6
│ │ ├─┬ @babel/template@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ ├─┬ @babel/traverse@7.22.8
│ │ │ ├─┬ @babel/generator@7.22.9
│ │ │ │ └── @babel/types@7.22.5  deduped
│ │ │ ├─┬ @babel/helper-function-name@7.22.5
│ │ │ │ └── @babel/types@7.22.5  deduped
│ │ │ ├─┬ @babel/helper-hoist-variables@7.22.5
│ │ │ │ └── @babel/types@7.22.5  deduped
│ │ │ ├─┬ @babel/helper-split-export-declaration@7.22.6
│ │ │ │ └── @babel/types@7.22.5  deduped
│ │ │ └── @babel/types@7.22.5  deduped
│ │ └── @babel/types@7.22.5
│ ├─┬ @babel/template@7.22.5
│ │ └── @babel/types@7.22.5  deduped
│ ├─┬ @babel/traverse@7.22.8
│ │ ├─┬ @babel/helper-function-name@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ ├─┬ @babel/helper-hoist-variables@7.22.5
│ │ │ └── @babel/types@7.22.5  deduped
│ │ └── @babel/types@7.22.5  deduped
│ └── @babel/types@7.22.5
├─┬ @babel/plugin-proposal-class-properties@7.18.6
│ └─┬ @babel/helper-create-class-features-plugin@7.22.0
│   ├─┬ @babel/helper-function-name@7.21.0
│   │ └── @babel/types@7.22.0  deduped
│   ├─┬ @babel/helper-member-expression-to-functions@7.22.0
│   │ └── @babel/types@7.22.0  deduped
│   ├─┬ @babel/helper-optimise-call-expression@7.18.6
│   │ └── @babel/types@7.22.0  deduped
│   ├─┬ @babel/helper-replace-supers@7.21.5
│   │ └── @babel/types@7.22.0  deduped
│   └─┬ @babel/helper-split-export-declaration@7.18.6
│     └── @babel/types@7.22.0  deduped
├─┬ @babel/plugin-proposal-optional-chaining@7.21.0
│ └─┬ @babel/helper-skip-transparent-expression-wrappers@7.20.0
│   └── @babel/types@7.22.0  deduped
├─┬ @babel/plugin-proposal-private-property-in-object@7.21.0
│ └─┬ @babel/helper-annotate-as-pure@7.18.6
│   └── @babel/types@7.22.0  deduped
├─┬ @babel/preset-env@7.22.0
│ ├─┬ @babel/plugin-transform-async-generator-functions@7.22.0
│ │ └─┬ @babel/helper-remap-async-to-generator@7.18.9
│ │   ├─┬ @babel/helper-wrap-function@7.20.5
│ │   │ └── @babel/types@7.22.0  deduped
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-computed-properties@7.21.5
│ │ └─┬ @babel/template@7.21.9
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-exponentiation-operator@7.18.6
│ │ └─┬ @babel/helper-builder-binary-assignment-operator-visitor@7.22.0
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-modules-amd@7.20.11
│ │ └─┬ @babel/helper-module-transforms@7.22.0
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-modules-commonjs@7.21.5
│ │ └─┬ @babel/helper-simple-access@7.21.5
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/plugin-transform-modules-systemjs@7.22.0
│ │ └─┬ @babel/helper-hoist-variables@7.18.6
│ │   └── @babel/types@7.22.0  deduped
│ ├─┬ @babel/preset-modules@0.1.5
│ │ └── @babel/types@7.22.0  deduped
│ └── @babel/types@7.22.0
├─┬ @babel/preset-react@7.22.0
│ └─┬ @babel/plugin-transform-react-jsx@7.22.0
│   └── @babel/types@7.22.0  deduped
├─┬ @cypress/code-coverage@3.10.6
│ └─┬ nyc@15.1.0
│   └─┬ istanbul-lib-instrument@4.0.3
│     └─┬ @babel/core@7.22.0
│       ├─┬ @babel/helpers@7.22.0
│       │ └── @babel/types@7.22.0  deduped
│       └── @babel/types@7.22.0  deduped
├─┬ babel-plugin-istanbul@6.1.1
│ └─┬ istanbul-lib-instrument@5.2.1
│   └─┬ @babel/core@7.22.0
│     ├─┬ @babel/helpers@7.22.0
│     │ └── @babel/types@7.22.0  deduped
│     └── @babel/types@7.22.0  deduped
├─┬ babel-plugin-styled-components@2.0.6
│ └─┬ @babel/helper-module-imports@7.21.4
│   └── @babel/types@7.22.0  deduped
├─┬ jest@27.5.1
│ └─┬ @jest/core@27.5.1
│   ├─┬ @jest/transform@27.5.1
│   │ └─┬ @babel/core@7.22.0
│   │   ├─┬ @babel/helpers@7.22.0
│   │   │ └── @babel/types@7.22.0  deduped
│   │   └── @babel/types@7.22.0  deduped
│   ├─┬ jest-config@27.5.1
│   │ ├─┬ @babel/core@7.22.0
│   │ │ ├─┬ @babel/helpers@7.22.0
│   │ │ │ └── @babel/types@7.22.0  deduped
│   │ │ └── @babel/types@7.22.0  deduped
│   │ └─┬ babel-jest@27.5.1
│   │   ├─┬ @types/babel__core@7.20.1
│   │   │ ├── @babel/types@7.22.0  deduped
│   │   │ ├─┬ @types/babel__generator@7.6.4
│   │   │ │ └── @babel/types@7.22.0  deduped
│   │   │ └─┬ @types/babel__template@7.4.1
│   │   │   └── @babel/types@7.22.0  deduped
│   │   └─┬ babel-preset-jest@27.5.1
│   │     └─┬ babel-plugin-jest-hoist@27.5.1
│   │       └── @babel/types@7.22.0  deduped
│   └─┬ jest-snapshot@27.5.1
│     ├─┬ @babel/core@7.22.0
│     │ ├─┬ @babel/helpers@7.22.0
│     │ │ └── @babel/types@7.22.0  deduped
│     │ └── @babel/types@7.22.0  deduped
│     ├── @babel/types@7.22.0  deduped
│     └─┬ @types/babel__traverse@7.20.0
│       └── @babel/types@7.22.0  deduped
├─┬ next@10.2.3
│ └─┬ styled-jsx@3.3.2
│   └── @babel/types@7.8.3
└─┬ styled-components@5.3.5
  └─┬ @babel/traverse@7.22.0
    ├─┬ @babel/generator@7.22.0
    │ └── @babel/types@7.22.0  deduped
    └── @babel/types@7.22.0  deduped

@nicolo-ribaudo
Copy link
Member

Thank you! Do you also have the error stack trace?

The underlying problem is mixing different versions of @babel/types and using them together. There is something that is using a modern version @babel/traverse and @babel/types, and the passing it to the old version of @babel/types used by styled-jsx.

I think we could relax the error and make it a warning instead, to avoid this problem in the future, but we cannot retroactively change @babel/types@7.8.3.

@7orry
Copy link

7orry commented Jul 13, 2023

Thank you! Do you also have the error stack trace?

The underlying problem is mixing different versions of @babel/types and using them together. There is something that is using a modern version @babel/traverse and @babel/types, and the passing it to the old version of @babel/types used by styled-jsx.

I think we could relax the error and make it a warning instead, to avoid this problem in the future, but we cannot retroactively change @babel/types@7.8.3.

thank you @nicolo-ribaudo, i think we don't have much informations on the stack trace

info  - Using external babel configuration from /app/.babelrc.js
Failed to compile.
./components/_common/error-page/error-page.js
Error: /app/components/_common/error-page/error-page.js: You gave us a visitor for the node type ClassAccessorProperty but it's not a valid type
> Build error occurred
Error: > Build failed because of webpack errors
    at /app/node_modules/next/dist/build/index.js:17:924
    at async Span.traceAsyncFn (/app/node_modules/next/dist/telemetry/trace/trace.js:6:584)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

i tried to override the @babel/types but it didn't work, but like you said if the changing of the error to warning will fix it, i will be grateful

@nicolo-ribaudo
Copy link
Member

Oh, you are on a version of next that bundles an old version of @babel/types. Unfortunately there is no way for you to update it without also updating next. Something in your Babel plugins is using a newer non-bundled version of @babel/types, and it's using its list of supported features. Since the bundled version supports less features, it breaks.

I think the only solution is to make sure that your unbundled version of @babel/types matches the bundled version, by adding "@babel/types": "7.12.12" to your resolutions. You might also have to do the same for @babel/traverse and @babel/core.

if the changing of the error to warning will fix it, i will be grateful

It will fix the error only once Next updates their bundled Babel version to the new version.

@aatishbarnwal
Copy link

@johnny-washswat , Thanks for your input, It worked for us , you made my day :).

  • Didn't do any update of @babel/Core
  • Just added below in package.JSON as suggested
    "resolutions": {
    "@babel/types": "7.22.5"
    }

And UI was up and running, Thanks @JLHwung for all your assistance over this, Really appreciate.

@7orry
Copy link

7orry commented Jul 13, 2023

@aatishbarnwal can you please share which next.js version you use and also the babel/* versions 🙏🏻 ?

@7orry
Copy link

7orry commented Jul 13, 2023

Oh, you are on a version of next that bundles an old version of @babel/types. Unfortunately there is no way for you to update it without also updating next. Something in your Babel plugins is using a newer non-bundled version of @babel/types, and it's using its list of supported features. Since the bundled version supports less features, it breaks.

I think the only solution is to make sure that your unbundled version of @babel/types matches the bundled version, by adding "@babel/types": "7.12.12" to your resolutions. You might also have to do the same for @babel/traverse and @babel/core.

if the changing of the error to warning will fix it, i will be grateful

It will fix the error only once Next updates their bundled Babel version to the new version.

Hello again @nicolo-ribaudo, like @JLHwung mentioned that ClassAccessorProperty was introduced in v7.17.0 i tried to update all the babel dependencies to v7.17.x like this:

    "@babel/cli": "7.17.10",
    "@babel/core": "7.17.12",
    "@babel/node": "^7.17.10",
    "@babel/plugin-proposal-class-properties": "^7.17.12",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.17.12",
    "@babel/plugin-proposal-optional-chaining": "^7.17.12",
    "@babel/plugin-proposal-private-methods": "^7.17.12",
    "@babel/plugin-proposal-private-property-in-object": "^7.17.12",
    "@babel/preset-env": "^7.17.12",
    "@babel/preset-react": "^7.17.12",
    "@babel/traverse": "7.17.12",
    "@babel/types": "7.17.12",

and also added the resolution like you suggested

"resolutions": {
    "@babel/core": "7.17.12",
    "@babel/types": "7.17.12",
    "@babel/traverse": "7.17.12"
  },

but sill have the same error message, am i doing the resolution wrong @nicolo-ribaudo ?

@7orry
Copy link

7orry commented Jul 14, 2023

any more help please on this, i'm still blocked 🙏🏻

@nicolo-ribaudo
Copy link
Member

You need an older version, that does not include ClassAccessorProperty in the supported features, so that it can work with the even older version bundled by Next.js (7.12.12)

@SouthLink
Copy link

SouthLink commented Jul 17, 2023

I tried version configuration a number of times, and this problem was also solved under the old version of next, which needed to be fixed by adding the following configuration to lock the dependent version

"resolutions": {
"@babel/core": "7.21.3",
"@babel/types": "7.21.3",
"@babel/traverse": "7.21.3"
}
Especially with "@babel/traverse" , it has to be added
It took a day. I'm gonna cry

@CreateSun
Copy link

Try this code in your package.json, it effect for me.

"overrides": {
"@babel/traverse": "7.22.6"
},

@7orry
Copy link

7orry commented Jul 18, 2023

thanks a lot 🙏🏻 @nicolo-ribaudo for your help we finally fixed the issue by upgrading Next.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

15 participants