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

"TypeError: Cannot read property 'flags' of undefined" when using yarn plug-and-play #47512

Closed
macrozone opened this issue Jan 19, 2022 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@macrozone
Copy link

Bug Report

i switched to yarn 2 and want to enable plug-and-play in a typescript monorepo.

i managed to run yarn 2 successfully with nodeLinker: node-module, but if i remove it to use "plug and play",
the build throws an error:

➤ YN0000: [@my/project]: TypeError: Cannot read property 'flags' of undefined
➤ YN0000: [@my/project]:     at getPropertyOfObjectType (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:47238:22)
➤ YN0000: [@my/project]:     at getPropertyOfType (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:47800:24)
➤ YN0000: [@my/project]:     at resolveESModuleSymbol (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:40994:54)
➤ YN0000: [@my/project]:     at getTargetOfNamespaceImport (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:40281:28)
➤ YN0000: [@my/project]:     at getTargetOfAliasDeclaration (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:40495:28)
➤ YN0000: [@my/project]:     at resolveAlias (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:40536:30)
➤ YN0000: [@my/project]:     at getSymbol (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:39315:38)
➤ YN0000: [@my/project]:     at resolveNameHelper (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:39554:34)
➤ YN0000: [@my/project]:     at resolveName (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:39538:20)
➤ YN0000: [@my/project]:     at resolveEntityName (/path/to/project/.yarn/cache/typescript-patch-0b90225f97-2e488dde7d.zip/node_modules/typescript/lib/tsc.js:40663:42)
➤ YN0000: [@my/project]: Process exited (exit code 1), completed in 3s 706ms

to be honest, i am not sure if its a typescript problem. The above error refers to a typescript-patch version. not sure what that is

🔎 Search Terms

  • "TypeError: Cannot read property 'flags' of undefined"
  • yarn "TypeError: Cannot read property 'flags' of undefined"
  • yarn pnp "TypeError: Cannot read property 'flags' of undefined"

🕗 Version & Regression Information

i was unable to run it with the next version (nightly) due to some typing problem with @types/node

i tried however 4.5.3 and 4.5.2 and both showed the same problem.

🙁 Actual behavior

throws the error shown above

🙂 Expected behavior

typescript should work with yarn plug and play

@IllusionMH
Copy link
Contributor

Same stack that was in issue already fixed in Nightly builds - #47348

@macrozone
Copy link
Author

@IllusionMH yesterday i was unable to use the nightly build, I got some conflict with the https://www.npmjs.com/package/@types/node version, but i can try again

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jan 20, 2022
@RyanCavanaugh
Copy link
Member

The top three frames are identical so I'm reasonably confident this is a duplicate. Please open a fresh issue if this turns out to be wrong. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants