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

Cannot read property 'arguments' of undefined #12

Open
aladdin-add opened this issue Dec 15, 2020 · 3 comments
Open

Cannot read property 'arguments' of undefined #12

aladdin-add opened this issue Dec 15, 2020 · 3 comments
Labels
bug Something isn't working upstream Blocked on upstream dependency

Comments

@aladdin-add
Copy link

aladdin-add commented Dec 15, 2020

Build completed in 78.241s


Build completed in 0s

TypeError: /Users/weiran/repo/dian/honor/assets/~containers~a~count~cash-114e7fb5.js: Cannot read property 'arguments' of undefined
    at NodePath._getKey (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/family.js:194:25)
    at NodePath.get (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/family.js:186:17)
    at NodePath._getPattern (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/family.js:226:21)
    at NodePath.get (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/family.js:188:17)
    at visitParam (/Users/weiran/repo/dian/honor/node_modules/babel-preset-modernize/dist/plugins/transform-destructuring/index.js:1:5836)
    at PluginPass.VariableDeclarator (/Users/weiran/repo/dian/honor/node_modules/babel-preset-modernize/dist/plugins/transform-destructuring/index.js:1:7332)
    at newFn (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/visitors.js:175:21)
    at NodePath._call (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/context.js:55:20)
    at NodePath.call (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/context.js:42:17)
    at NodePath.visit (/Users/weiran/repo/dian/honor/node_modules/optimize-plugin/node_modules/@babel/traverse/lib/path/context.js:92:31)
error Command failed with exit code 1.
@leonardofaria
Copy link

Happening the same here.

Was trying to troubleshoot here but not sure where to start.

I have tried removing the preset extra configs and sourceType but no success.

module.exports = function (api) { // eslint-disable-line func-names
  api.cache(true);

  const presets = [
    ['@babel/preset-env', {
      targets: {
        browsers: ['last 2 versions']
      },
      useBuiltIns: 'usage',
      corejs: '3.0.0'
    }],
    '@babel/react'
  ];

  const plugins = [
    '@babel/plugin-syntax-dynamic-import',
    '@babel/plugin-proposal-class-properties',
    '@babel/plugin-proposal-do-expressions',
    '@babel/plugin-proposal-export-default-from',
    '@babel/plugin-transform-runtime'
  ];

  return {
    presets,
    plugins,
    sourceType: 'module'
  };
};

@developit
Copy link
Owner

developit commented Feb 22, 2021

Just an update: I have a fix for this in babel-preset-modernize that should be released soon.

In the meantime, you can disable automatic modernization by passing new OptimizePlugin({ modernize: false }).

@developit developit added bug Something isn't working upstream Blocked on upstream dependency labels Feb 2, 2022
@cjones26
Copy link

@developit, do you have a link to the PR with this fix? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Blocked on upstream dependency
Projects
None yet
Development

No branches or pull requests

4 participants