Automattic / mongoose

MongoDB object modeling designed to work in an asynchronous environment.
https://mongoosejs.com
MIT License
26.88k stars 3.83k forks source link

Upgrading from v5.11.x to v5.13.x causes memory leaks in ESLint #11208

Closed tubbo closed 1 year ago

tubbo commented 2 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Crashes while running ESLint due to OOM:

$ eslint . --ext js --ext ts --ext tsx --ext json

<--- Last few GCs --->

[2322:0x6250a20]    86941 ms: Mark-sweep (reduce) 2042.3 (2054.1) -> 2041.4 (2054.3) MB, 2064.6 / 0.0 ms  (average mu = 0.110, current mu = 0.056) allocation failure scavenge might not succeed
[2322:0x6250a20]    89098 ms: Mark-sweep (reduce) 2042.5 (2051.3) -> 2041.7 (2052.8) MB, 2152.4 / 0.0 ms  (average mu = 0.057, current mu = 0.002) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 2: 0x96e0af node::FatalError(char const*, char const*) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 5: 0xd73fd5  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 6: 0xd74b5f  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 9: 0xd4bd2d v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
10: 0xd47f89 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
11: 0xd48044 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
12: 0xf8f6de v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
13: 0xf8f876 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
14: 0x1081088 v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
15: 0x1446379  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
Aborted (core dumped)
error Command failed with exit code 134.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Upgrade to latest Mongoose v5.13.x patch
  2. ESLint will blow up

TSConfig:

{
  "compilerOptions": {
    /* Visit https://aka.ms/tsconfig.json to read more about this file */

    /* Basic Options */
    // "incremental": true,                   /* Enable incremental compilation */
    "target": "es2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
    "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
    "lib": [
      "es2020.Promise"
    ] /* Specify library files to be included in the compilation. */,
    "allowJs": true /* Allow javascript files to be compiled. */,
    "checkJs": false /* Report errors in .js files. */,
    // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
    // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
    // "sourceMap": true,                     /* Generates corresponding '.map' file. */
    // "outFile": "./",                       /* Concatenate and emit output to single file. */
    "outDir": "./dist" /* Redirect output structure to the directory. */,
    // "rootDir": "./",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
    // "composite": true,                     /* Enable project compilation */
    // "tsBuildInfoFile": "./",               /* Specify file to store incremental compilation information */
    // "removeComments": true,                /* Do not emit comments to output. */
    // "noEmit": true,                        /* Do not emit outputs. */
    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
    // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

    /* Strict Type-Checking Options */
    "strict": true /* Enable all strict type-checking options. */,
    // "noImplicitAny": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */
    // "strictNullChecks": true,              /* Enable strict null checks. */
    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
    // "strictBindCallApply": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
    // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
    // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */

    /* Additional Checks */
    // "noUnusedLocals": true,                /* Report errors on unused locals. */
    // "noUnusedParameters": true,            /* Report errors on unused parameters. */
    // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
    // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */
    // "noUncheckedIndexedAccess": true,      /* Include 'undefined' in index signature results */

    /* Module Resolution Options */
    "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
    "typeRoots": [
      /* List of folders to include type definitions from. */ "./src/types",
      "node_modules/@types",
      "../node_modules/@types"
    ],
    // "types": [],                           /* Type declaration files to be included in compilation. */
    // "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
    "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */
    // "allowUmdGlobalAccess": true,          /* Allow accessing UMD globals from modules. */
    "resolveJsonModule": true,

    /* Source Map Options */
    // "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */
    // "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */
    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
    // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

    /* Experimental Options */
    // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */

    /* Advanced Options */
    "skipLibCheck": true /* Skip type checking of declaration files. */,
    "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
  }
}

What is the expected behavior?

My ESLint task doesn't fail due to OOM

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.

I'd love to use the latest version of Mongoose but upgrading it at all tends to break.

vkarpov15 commented 2 years ago

What does your ESLint config look like? And what does your code look like? ESLint doesn't go into ./node_modules by default, so we'll need more info.

tubbo commented 2 years ago

@vkarpov15 I don't think we are trying to go into ./node_modules, but here is my full .eslintrc.js:

const ERROR_IN_CI = process.env.CI ? 'error' : 'warn'
const path = require('path')

module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
    node: true,
    jest: true,
  },
  globals: {
    fail: true, // false=not writable, true=writable
    globalThis: false,
  },
  plugins: ['import', 'testing-library', 'jest-dom'],
  extends: ['eslint:recommended', 'prettier'],
  parserOptions: {
    ecmaVersion: 2020,
  },
  rules: {
    'import/namespace': 'off',
    'no-console': [ERROR_IN_CI, { allow: ['error'] }],
  },
  settings: {
    react: {
      version: 'detect',
    },
  },
  overrides: [
    // Scripts can have console statements
    {
      files: ['api/scripts/**/*'],
      rules: {
        'no-console': 'off',
      },
    },
    // React Apps
    {
      files: ['web/**/*', 'cms/**/*'],
      env: {},
      parser: '@babel/eslint-parser',
      parserOptions: {
        ecmaFeatures: {
          jsx: true,
        },
        sourceType: 'module',
        babelOptions: {
          configFile: './web/.babelrc',
        },
      },
      extends: ['plugin:jsx-a11y/recommended'],
      plugins: ['prefer-arrow'],
      rules: {
        'prefer-arrow/prefer-arrow-functions': 'error',
        'react/prop-types': 'off',
        'import/no-unresolved': [2, { ignore: ['^(all|part):'] }], // ignore Sanity part imports
        'jsx-a11y/anchor-is-valid': 'off', // temp for now, until better way to exclude Next Links
        'jsx-a11y/no-static-element-interactions': 'off', // temp for now, until better way to exclude Next Links
      },
      globals: {
        twttr: true,
      },
    },
    {
      files: ['**/*.ts?(x)'],
      parser: '@typescript-eslint/parser',
      parserOptions: {
        ecmaFeatures: {
          jsx: true,
        },
        tsconfigRootDir: __dirname,
        warnOnUnsupportedTypescriptVersion: true,
      },
      plugins: ['@typescript-eslint', 'typescript-sort-keys'],
      extends: [
        'plugin:@typescript-eslint/recommended',
        'plugin:@typescript-eslint/recommended-requiring-type-checking',
        'plugin:typescript-sort-keys/recommended',
      ],
      rules: {
        '@typescript-eslint/no-unused-vars': [
          'error',
          { argsIgnorePattern: '^_' },
        ],
        '@typescript-eslint/restrict-template-expressions': 'off',
        '@typescript-eslint/no-unsafe-member-access': 'off', // to be turned back on shortly
        '@typescript-eslint/no-unsafe-call': 'off', // to be turned back on shortly
        '@typescript-eslint/no-unsafe-return': 'off', // to be turned back on shortly
        '@typescript-eslint/no-unsafe-assignment': 'off', // to be turned back on shortly
        '@typescript-eslint/no-floating-promises': 'off', // to be turned back on shortly
        '@typescript-eslint/ban-ts-comment': [
          'error',
          {
            'ts-nocheck': 'allow-with-description',
          },
        ],
        '@typescript-eslint/explicit-module-boundary-types': 'off',
        '@typescript-eslint/no-extra-semi': 'off',
        // TODO: We can't turn this off until we get rid of Mongoose.
        '@typescript-eslint/no-unsafe-argument': 'off',
      },
    },

    {
      files: ['web/**/*.ts?(x)'],
      extends: ['next'],
      parserOptions: {
        project: ['web/tsconfig.json'],
      },
      rules: {
        // TODO: The following are good rules to have but we
        // break them too often. Go through the codebase and fix
        // all these instances of explicit any or ignore the rule
        // on specific lines.
        '@typescript-eslint/unbound-method': 'off',
        '@typescript-eslint/explicit-function-return-type': 'off',
        '@typescript-eslint/no-explicit-any': 'off',
        '@typescript-eslint/no-non-null-assertion': 'off',
        'react-hooks/exhaustive-deps': 'off',
        '@next/next/no-html-link-for-pages': [
          'error',
          path.join(process.cwd(), 'src', 'pages'),
        ],
      },
      settings: {
        'import/parsers': {
          '@typescript-eslint/parser': ['.ts', '.tsx'],
        },
        'import/resolver': {
          typescript: {
            project: 'web/tsconfig.json',
          },
        },
      },
    },

    {
      files: [
        'web/**/__tests__/**/*.[jt]s?(x)',
        'web/**/?(*.)+(spec|test).[jt]s?(x)',
      ],
      extends: ['plugin:testing-library/react', 'plugin:jest-dom/recommended'],
    },

    // API
    {
      files: ['api/**/*'],
      globals: {
        fail: true,
      },
      rules: {
        'no-unused-vars': 'off',
        'multiline-ternary': 'off',
        'prefer-regex-literals': 'off',
      },
      parserOptions: {
        project: ['api/tsconfig.json'],
      },
    },

    // JSON Configuration Files
    {
      extends: ['plugin:json/recommended-with-comments'],
      files: ['**/*.json'],
      plugins: ['json'],
    },
    {
      files: ['component-library/**/*.ts?(x)'],
      parserOptions: {
        project: ['component-library/tsconfig.eslint.json'],
      },
      rules: {
        '@typescript-eslint/explicit-function-return-type': 'off',
      },
    },
  ],
}

we also have an .eslintignore file at the root of our repo:

!**/.eslintrc*
*node_modules*
*.svg
*.ico
.gitignore
*.md
*.log
*yarn.lock
.yarn
web/!.storybook
web/storybook-static
web/tmp
web/src/models.tsx
web/src/operations.ts
api/src/http/graphql/generated*
api/dist
web/.next
cms/dist/**

I'm going to try to see if ESLint is indeed encountering vendored dependencies or something by setting DEBUG="eslint:file-enumerator" in CI. From what I can tell this isn't happening locally, so maybe it's a GitHub Actions thing..

tubbo commented 2 years ago

I can confirm that we are not iterating over node_modules/ directories at all in my application.

[...]

2022-01-13T22:00:11.307Z eslint:file-enumerator Enter the directory: /home/runner/work/lobby/lobby/web/config
2022-01-13T22:00:11.310Z eslint:file-enumerator Yield: redirects.json
2022-01-13T22:00:11.518Z eslint:file-enumerator Leave the directory: /home/runner/work/lobby/lobby/web/config
2022-01-13T22:00:11.541Z eslint:file-enumerator Yield: jest-setup.ts

<--- Last few GCs --->

[2120:0x5566a20]    92940 ms: Mark-sweep 2042.4 (2064.6) -> 2039.5 (2066.4) MB, 2303.6 / 0.0 ms  (average mu = 0.076, current mu = 0.006) allocation failure scavenge might not succeed
[2120:0x5566a20]    95263 ms: Mark-sweep (reduce) 2047.8 (2066.6) -> 2042.7 (2068.6) MB, 2254.2 / 0.0 ms  (+ 0.1 ms in 126 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2323 ms) (average mu = 0.053, current mu = 0.029)

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 2: 0x96e0af node::FatalError(char const*, char const*) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 5: 0xd73fd5  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 6: 0xd74b5f  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
 9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
11: 0x1446379  [/opt/hostedtoolcache/node/14.18.2/x64/bin/node]
Aborted (core dumped)
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "lint:analysis" exited with 134.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

I looked through the whole backlog of eslint:file-enumerator debug messages, and couldn't find a single instance of it diving into a node_modules/ dir of any kind.

I'm pretty stumped, honestly. Might try and bisect the past versions of Mongoose, because at this point every time Renovate asks us to upgrade the library we run into this same issue and can't proceed.

James1x0 commented 2 years ago

Having the exact same problem w/ tsc and mongoose breaking the typescript build via OOM.

node --max-old-space-size=8192 ./node_modules/.bin/tsc --diagnostics --project tsconfig.production.json

<--- Last few GCs --->

[24997:0x7f7f29100000]   445689 ms: Mark-sweep 8091.8 (8237.4) -> 8087.9 (8237.9) MB, 29434.8 / 0.0 ms  (average mu = 0.073, current mu = 0.001) allocation failure scavenge might not succeed
[24997:0x7f7f29100000]   479110 ms: Mark-sweep 8092.2 (8237.9) -> 8088.6 (8238.6) MB, 33364.2 / 0.0 ms  (average mu = 0.032, current mu = 0.002) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10e13c815 node::Abort() (.cold.1) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 2: 0x10ce3baa9 node::Abort() [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 3: 0x10ce3bc1f node::OnFatalError(char const*, char const*) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 4: 0x10cfbc877 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 5: 0x10cfbc813 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 6: 0x10d15dc65 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 7: 0x10d161cad v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 8: 0x10d15e58d v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
 9: 0x10d15baad v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
10: 0x10d168de0 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
11: 0x10d168e61 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
12: 0x10d135fb7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
13: 0x10d4eb89e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
14: 0x10d8952b9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/james/.nvm/versions/node/v16.13.1/bin/node]
15: 0x1155613fa 
tubbo commented 2 years ago

thank you @James1x0 i was hoping i wasn't just insane! we're using TypeScript as well. this code exists within a monorepo, but the API part of the monorepo is where all the mongoose code is located, and also the part of the app that's keeping us on an older version of typescript, v4.1.3 to be exact. not sure if that has anything to do with it..

vkarpov15 commented 2 years ago

So the issue might be with TypeScript, not ESLint. What does your tsconfig look like? You might try setting the skipLibCheck option and see if that helps.

tubbo commented 2 years ago

@vkarpov15 I have skipLibCheck set to true in my TSConfig (posted in the OP)

James1x0 commented 2 years ago

@vkarpov15 Also have skipLibCheck true. Can confirm after running "--generateTrace" with typescript build, the build slows significantly and specifically on our model declaration files until it comes to a halt running out of memory. Still in the middle of profiling the build. Can confirm that mongoose@6.1.7 resolves this issue, but hoping to delay the major upgrade.

tubbo commented 2 years ago

We're trying to deal with the major version upgrade to fix these issues but I have to be honest, I'm not really looking forward to it. Lots of work and risk on our part just because Mongoose doesn't play nice with TypeScript?

vkarpov15 commented 1 year ago

We took a quick look, but there's no way we're realistically going to repro this. tsconfig.json isn't even valid JSON, ESLint config is invalid, can't even get the full setup to run after installing what seems like half of npm. Without a working repro script, there's no way we're going to be able to figure this out, so if you're still having this issue please open a new issue and follow the issue template.