coderaiser / putout

🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
https://putout.cloudcmd.io/
MIT License
698 stars 40 forks source link

Callstack error on version 32.1.x or newer #184

Closed faran-tenovos closed 11 months ago

faran-tenovos commented 11 months ago

On putout version 32.1.x or 32.2.0 I get the following error

eslint --cache --cache-location .next/cache/eslint/ --fix:

Oops! Something went wrong! :(

ESLint: 8.50.0

RangeError: Maximum call stack size exceeded
    at NodePath.isBlockScoped (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:41952:23)
    at Object.newFn (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:37691:30)
    at NodePath._call (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:40821:20)
    at NodePath.call (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:40808:14)
    at NodePath.visit (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:40855:31)
    at TraversalContext.visitQueue (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:42250:16)
    at TraversalContext.visitSingle (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:42229:19)
    at TraversalContext.visit (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:42273:19)
    at traverseNode (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:42291:17)
    at NodePath.visit (/some-user/node_modules/.pnpm/@putout+babel@1.1.1/node_modules/@putout/babel/bundle/babel.cjs:40861:21)
husky - pre-commit hook exited with code 1 (error)

While this works fine on version 32.0.7

coderaiser commented 11 months ago

Could you show me js file you trying to lint

faran-tenovos commented 11 months ago

It is a full project on which I'm running it. I'm using eslint-plugin-putout

coderaiser commented 11 months ago

What version? Can you reproduce this with one file? Have you modified configs?

coderaiser commented 11 months ago

Looks like you have old version of @putout/babel consider upgrade, and try to use npm or yarn to install dependencies

faran-tenovos commented 11 months ago

I'm not using @putout/babel

coderaiser commented 11 months ago

It is dependency used by 🐊Putout, in your stack trace: pnpm/@putout+babel@1.1.1, but that is not the latest version, should be 1.2.2, maybe problem with pnpm?

faran-tenovos commented 11 months ago

Tried removing pnpm cache using pnpm store prune deleted node_modules, pnpm-lock file too but still getting the stack trace error on the latest version

coderaiser commented 11 months ago

Try to install with npm, check version of installed @putout/babel, what version do you have?

faran-tenovos commented 11 months ago

It works with npm, something is wrong pnpm. Thanks

coderaiser commented 11 months ago

Sometimes package managers messing with dependencies, I have a similar problem with Bun https://github.com/coderaiser/putout/actions/runs/6347747012/job/17243207041 (only in this repo), it somehow installs ESLint in the wrong way 🤷

faran-tenovos commented 10 months ago

@coderaiser any fix on this issue I've switched from pnpm to bun and the same issue and I can see that you too are having this issue I think it has something to do with how they build symlinks instead of actually cloning as npm does. But srangely enough it works with versions 32.0.7 or lower. With pnpm or bun both

coderaiser commented 10 months ago

The thing is everything works good with not: yarn and npm, so I have no idea what is the problem with bun and pnpm, anyways I created issue about it https://github.com/oven-sh/bun/issues/4473