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

2.23.0: Cannot read property 'esModuleInterop' of undefined #2067

Closed
SethDavenport opened this issue May 14, 2021 · 3 comments
Closed

2.23.0: Cannot read property 'esModuleInterop' of undefined #2067

SethDavenport opened this issue May 14, 2021 · 3 comments

Comments

@SethDavenport
Copy link

Upgraded from 2.22.1 to 2.23.0 on a typescript project and started getting this error. Downgrading back to 2.22.1 fixes it.

Running eslint

Oops! Something went wrong! :(

ESLint: 7.26.0

TypeError: Cannot read property 'esModuleInterop' of undefined
Occurred while linting /home/********/wealthsimple/src/admin/admin-utilities/components/role-manager/components/child-column/child-column.component.tsx:11
    at isEsModuleInterop (/home/********/wealthsimple/node_modules/eslint-plugin-import/lib/ExportMap.js:727:385)
    at /home/********/wealthsimple/node_modules/eslint-plugin-import/lib/ExportMap.js:734:128
    at Array.forEach (<anonymous>)
    at Function.ExportMap.parse (/home/********/wealthsimple/node_modules/eslint-plugin-import/lib/ExportMap.js:727:419)
    at Function.ExportMap.for (/home/********/wealthsimple/node_modules/eslint-plugin-import/lib/ExportMap.js:721:201)
    at Function.ExportMap.get (/home/********/wealthsimple/node_modules/eslint-plugin-import/lib/ExportMap.js:715:463)
    at checkSourceValue (/home/********/wealthsimple/node_modules/eslint-plugin-import/lib/rules/no-cycle.js:68:44)
    at checkSourceValue (/home/********/wealthsimple/node_modules/eslint-module-utils/moduleVisitor.js:29:5)
    at checkSource (/home/********/wealthsimple/node_modules/eslint-module-utils/moduleVisitor.js:34:5)
    at /home/********/wealthsimple/node_modules/eslint/lib/linter/safe-emitter.js:45:58
error Command failed with exit code 2.

Env details:

  • node 12.18.1
  • yarn 1.22.10
  • eslint 7.26.0

Config details:

.eslintrc:

{
  "extends": [
    "./node_modules/@my-company/jstools-lint-web/config/eslint.config.js"
  ]
}

where ./node_modules/@my-company/jstools-lint-web/config/eslint.config.js:

module.exports = {
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:jest/recommended',
    'plugin:eslint-comments/recommended',
    'plugin:import/typescript',
    'plugin:prettier/recommended',
    'prettier',
  ],
  plugins: ['jest', 'json', 'react-hooks', 'jsx-a11y', 'import'],
  parser: '@typescript-eslint/parser',
  env: {
    browser: true,
    node: true,
    jest: true,
  },
  globals: {
    DEV_SERVER: true,
  },
  ignorePatterns: [
    `node_modules`,
    `flow-typed`,
    `__generated__`,
    '**/generated.*',
    '**/generated/*',
    '*.json',
    `coverage`,
    `dist`,
    'storybook-static',
  ],
  rules: {
    '@typescript-eslint/ban-ts-comment': [
      'error',
      { 'ts-ignore': 'allow-with-description' },
    ],
    'no-unused-vars': 'off',
    '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    'import/no-cycle': 'error',
    'import/no-self-import': 'error',
  },
  overrides: [
    {
      // enable the rule specifically for TSX files since it's
      // idiomatic to omit the return type from exported React
      // components specifically.
      files: ['*.ts'],
      rules: {
        '@typescript-eslint/explicit-module-boundary-types': ['warn']
      },
    },
  ],
};
@SethDavenport
Copy link
Author

I have a minimal repro repo but I'm having a hard time disentangling it from our internal toolchain packages. Seems to require a react component to be present however.

@ljharb
Copy link
Member

ljharb commented May 14, 2021

No worries, I was able to repro it :-)

@ljharb ljharb closed this as completed in d903477 May 14, 2021
@SethDavenport
Copy link
Author

Amazing, thanks!

GerkinDev added a commit to KnodesCommunity/eslint-config that referenced this issue May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants