Skip to content

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

Closed
@macrozone

Description

@macrozone

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions