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

vscode stuck on Initializing JS/TS language features on Apple Silicon. #51927

Closed
kartikbhalla12 opened this issue Dec 15, 2022 · 19 comments
Closed
Assignees
Labels
Fix Available A PR has been opened for this issue

Comments

@kartikbhalla12
Copy link

kartikbhalla12 commented Dec 15, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.74.0, OS: Darwin arm64 22.1.0
  • OS Version: Mac OS Ventura 13.0.1 (22A400) (Apple Silicon, M1 Pro)

Steps to Reproduce:

  1. Created a React-Native Project based of typescript, and have path alias added in babel.config.js and tsconfig.json
  2. When project opens, it shows initialising JS/TS features and disappears normally
  3. After some time (around 10 mins while developing in code, this randomly appears and never stops).
  4. This, stops intellisense to work and have to manually restart TS server

I have tried all the possible solutions provided in microsoft/vscode#68896 and none of them seem to work. I have tried clearing cache and re-installing vscode but issue still seems to persist.

After manually restarting ts server, this message doesn't seem to persist and works normally but after sometime again this appears

Attaching TS server logs and babel.config and tsconfig

babel.config.js

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      'module-resolver',
      {
        root: ['./src'],
        extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'],
        alias: {
          '@assets': './src/assets',
          '@api': './src/api',
          '@app': './src/app',
          '@components': './src/components',
          '@config': './src/config',
          '@constants': './src/constants',
          '@content': './src/content',
          '@hooks': './src/hooks',
          '@icons': './src/icons',
          '@interfaces': './src/interfaces',
          '@navigation': './src/navigation',
          '@screens': './src/screens',
          '@services': './src/services',
          '@styles': './src/styles',
          '@types': './src/types',
          '@utils': './src/utils',
        },
      },
    ],
    ['react-native-paper/babel'],
    ['optional-require'],
  ],
};

tsconfig

{
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "@api/*": ["api/*"],
      "@app/*": ["app/*"],
      "@assets/*": ["assets/*"],
      "@components/*": ["components/*"],
      "@config/*": ["config/*"],
      "@constants/*": ["constants/*"],
      "@content/*": ["content/*"],
      "@hooks/*": ["hooks/*"],
      "@icons/*": ["icons/*"],
      "@interfaces/*": ["interfaces/*"],
      "@navigation/*": ["navigation/*"],
      "@screens/*": ["screens/*"],
      "@services/*": ["services/*"],
      "@styles/*": ["styles/*"],
      "@types/*": ["types/*"],
      "@utils/*": ["utils/*"]
    },
    "skipLibCheck": true
  },
  "extends": "@tsconfig/react-native/tsconfig.json"
}

tsserver.log

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@mjbvz
Copy link
Contributor

mjbvz commented Dec 15, 2022

I think you may have attached the wrong log file. Can you please try uploading it again?

@kartikbhalla12
Copy link
Author

@mjbvz my bad sorry, re-attaching the file on this comment as well with the issue

tsserver.log

@mjbvz
Copy link
Contributor

mjbvz commented Dec 16, 2022

Thanks. Do completions and other IntelliSense feature work when you see the initializing indicator?

@kartikbhalla12
Copy link
Author

kartikbhalla12 commented Dec 16, 2022

Hey @mjbvz, unfortunately they don't work when this is visible

@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 16, 2022
@mjbvz
Copy link
Contributor

mjbvz commented Dec 16, 2022

Looks like the last message in the log is:

Info 1029 [11:37:16.996] Reloading configured project /Users/kartik.bhalla/Desktop/Projects/study-abroad-mobile-app/tsconfig.json
Info 1030 [11:37:16.996] event:
    {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/Users/kartik.bhalla/Desktop/Projects/study-abroad-mobile-app/tsconfig.json","reason":"Change in config file detected"}}

This suggests that TS may be trying to load the project when it gets stuck but it's hard to tell since nothing else is logged. Any ideas @sheetalkamat?

@mjbvz mjbvz removed their assignment Dec 16, 2022
@andrewbranch andrewbranch added the Needs Investigation This issue needs a team member to investigate its status. label Dec 19, 2022
@kartikbhalla12
Copy link
Author

@sheetalkamat let me know if you need any further logs from my end.

Thanks.

@sheetalkamat
Copy link
Member

Are you still able to repro this issue.

In the logs I see that tsserver is getting notifcation that file: /Users/kartik.bhalla/Desktop/Projects/study-abroad-mobile-app/tsconfig.json is changed. There seem to be many notifications oif that which keeps reloading the project. Can you please share the complete project along with the repro tsserver log so i can try to run similar steps to try it out locally to see what could be causing this.

@kartikbhalla12
Copy link
Author

Hi @sheetalkamat

I'm still facing the same issue. I won't be able to share the source code for this project as this is for the company I'm working with (upGrad).

However, I'll create a new project with the same configuration and will share it with you this weekend. Hope that's okay with you.

@bennyk8y
Copy link

Our entire development team suffer from this issue as well. Not sure its related to Apple Silicon or not, but our setup is different as its pnpm monorepo (e.g without babel).
Iv'e shared our codebase with VSCode team.

@Ambroza888
Copy link

Any solution to the issue? I am having the same issue and it is breaking everything ... It keeps spinning and stopping 'Initializing JS/TS language features'

I reinstalled the Vscode, moved to a different folder repo, used the insider version, and followed the comment in the logs it kept 'detecting change in the tscofing.ts'

It keeps happening ... ;/

@Ambroza888
Copy link

This one will fix your issue. https://www.codejourney.net/how-to-fix-visual-studio-code-intellisense-loading-infinitely/

Also if you open two repos in one folder for example MAIN FOLDER -> FE repo & BE repo make sure you enter inside of the BE or the FE and then follow the steps from the link I sent.

Happy coding.

@jakebailey
Copy link
Member

Can someone provide the verbose logs? That's what was requested. A description of them like "keeps detecting changes in tsconfig" is helpful, but not as good as the logs, which is what was requested.

@kartikbhalla12
Copy link
Author

@jakebailey these are the verbose logs only, I was not able to get more detailed logs than these. PS. still facing the issue.

@c0nf1gur4t0r
Copy link

Same problem here!

@sheetalkamat
Copy link
Member

@kartikbhalla12 to me this looks like it should have fixed with #56403
Can you try typescript nightly and see if this is fixed. Thanks

@kartikbhalla12
Copy link
Author

@sheetalkamat this seems to working fine now. Was waiting for this for a long time. Thanks a lot!

@sheetalkamat sheetalkamat added Fix Available A PR has been opened for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Jan 10, 2024
@ssadel
Copy link

ssadel commented Jul 12, 2024

for me, deleting node_modules + ts compiled dir fixed my issue

@sadjow
Copy link

sadjow commented Nov 22, 2024

If you encounter this issue, go to the output tab next to the terminal, select the Extension Host option, and you will see which extension is causing the initialization to freeze. You will need to uninstall it until the extension is updated to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue
Projects
None yet
Development

No branches or pull requests