If anyone encountered this problem while setting up their local dev environment, this is how I solved it.
The issue is to related how to VSCode is configured to run yarn v2+ plug-and-play TypeScript. When doing a vanilla install, you will notice that these imports will fail even though Grafana starts up normally - this is because Grafana is configured to work with yarn IDE SDKs. So VSCode needs to be configured to support them, if it isn’t already.
- Note in the Grafana repo, the package manager is declared in package.json. This is the version you should have on your machine
“packageManager”: “yarn@3.1.0”
- Install and set latest yarn version
yarn set version latest
- Install yarn’s IDE SDK for VSCode (the dlx command runs yarn in a separate environment, distinct from the workspace)
yarn dlx @yarnpkg/sdks vscode
- Restart VSCode