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

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

Closed
1 task done
julienfouilhe opened this issue Feb 1, 2022 · 3 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@julienfouilhe
Copy link
Contributor

julienfouilhe commented Feb 1, 2022

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

@julienfouilhe julienfouilhe added the bug Something isn't working label Feb 1, 2022
@julienfouilhe julienfouilhe changed the title [Bug?]: Typescript 4.6.0 patch does not work properly [Bug?]: Typescript 4.6.0 patch does not work properly: tools hang Feb 1, 2022
@julienfouilhe julienfouilhe changed the title [Bug?]: Typescript 4.6.0 patch does not work properly: tools hang [Bug?]: Typescript sdk for 4.6.0-beta does not work properly: tools hang Feb 1, 2022
@julienfouilhe
Copy link
Contributor Author

cc @merceyz do you think it could be linked to your PR? I tried to log some stuff in the sdk files but could not find something very incriminating.

@merceyz
Copy link
Member

merceyz commented Feb 14, 2022

The SDK is only supposed to be used by IDEs so #3991 shouldn't affect any other tools.

@julienfouilhe
Copy link
Contributor Author

julienfouilhe commented Feb 21, 2022

I saw a similar issue where it was suggested that it may be a node bug. I tried with node 16.14.0 and it's fixed! #4129 (comment)

I thought it was linked to my typescript upgrade, but didn't realize that I also had to upgrade yarn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants