Skip to content

[Bug?]: Typescript sdk for 4.6.0-beta does not work properly: tools hang #4053

@julienfouilhe

Description

@julienfouilhe

Self-service

  • I'd be willing to implement a fix

Describe the bug

I don't know if you welcome bug reports for the typescript sdk for the 4.6.0 version already since it's still in beta, but I've noticed a bug that occurs in two tools for me: Cypress and fork-ts-checker-webpack-plugin.

They both hang indefinitely.

I checked the Cypress logs, this is the last line that appears:

  cypress:server:plugins:child require pluginsFile +142ms

Which in the source code corresponds to:

    debug('require pluginsFile')
    plugins = require(pluginsFile)

The pluginsFile value is logged a little bit before and is .../test-cypress-ts-4.6.0/cypress/plugins/index.js which is just a simple file:

module.exports = (on, config) => {}

This makes me think some expected event listeners are never called or that messages are sent before listeners are registered?
For example next actions after this require are registering two event listeners which are never called:

  ipc.on('load', (config) => {
    debug('plugins load file "%s"', pluginsFile)
    debug('passing config %o', config)
    load(ipc, config, pluginsFile)
  })

  ipc.on('execute', (event, ids, args) => {
    execute(ipc, event, ids, args)
  })

Using the node-modules nodeLinker, the load event is called right after (i can see the plugins load file log).

To reproduce

https://github.com/julienfouilhe/repro-yarn-pnp-cypress-ts-4.6.0-bera

Running the following command will try to run some basic cypress tests with logs. You'll see that it hangs indefinitely.

yarn install
yarn start

I've seen the same thing happen with the fork-ts-checker webpack plugin

Environment

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.13.1 - /private/var/folders/s9/x9s630sd4xd287p7xfg6r49h0000gn/T/xfs-4dfd3851/node
    Yarn: 3.2.0-rc.13 - /private/var/folders/s9/x9s630sd4xd287p7xfg6r49h0000gn/T/xfs-4dfd3851/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm

Additional context

Could this be linked to this PR? #3991

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions