Skip to content

Bug: Eslint plugin failed downloads #2210

@jackw

Description

@jackw

Which package(s) does this bug affect?

  • Create Plugin
  • Sign Plugin
  • Plugin E2E
  • Plugin Meta Extractor
  • Plugin ESLint Rules

Package versions

0.5.0

What happened?

Due to changes in the structure of the bundled grafana npm packages (ui, data, runtime) depending on the version specified it can result in download failures.

Please wait... downloading Grafana types information for version 11.6.0.
Failed to download @grafana/data: HTTP status 404

Oops! Something went wrong! :(

ESLint: 9.28.0

Error: Error while loading rule '@grafana/plugins/import-is-compatible': Failed to download types for @grafana/[email protected]: Command failed: node -e "const https = require('https'); https.get('https://cdn.jsdelivr.net/npm/@grafana/[email protected]/dist/index.d.ts', (res) => {
            let data = '';
            res.on('data', chunk => data += chunk);
            res.on('end', () => {
              if (res.statusCode === 200) {
                require('fs').writeFileSync('/var/folders/7f/1_46h_kj2d15rltqk2jzh81c0000gn/T/gf-eslint-plugin-compatible-11.6.0/node_modules/@grafana/data/index.d.ts', data);
                process.exit(0);
              }
              console.error('Failed to download @grafana/data: HTTP status ' + res.statusCode);
              process.exit(1);
            });
          }).on('error', (e) => {
            console.error('Failed to download @grafana/data: ' + e.message);
            process.exit(1);
          })"
Failed to download @grafana/data: HTTP status 404

Additionally versions after 12.1.0 contain multiple typescript definition files resulting in false positives where only the index.d.ts is downloaded rather than all the d.ts files:

Please wait... downloading Grafana types information for version 12.1.0.

/Users/jackwestbrook/dev/grafana/scenes/packages/scenes/src/components/SceneApp/SceneApp.test.tsx
  2:10  warning  The member "locationService" is not available in all runtime environments that this plugin supports. Make sure to check if the member is undefined before accessing it, or it may cause runtime errors. "@grafana/[email protected]" does not export member "locationService"  @grafana/plugins/import-is-compatible

/Users/jackwestbrook/dev/grafana/scenes/packages/scenes/src/components/SceneApp/utils.ts
  3:10  warning  The member "locationSearchToObject" is not available in all runtime environments that this plugin supports. Make sure to check if the member is undefined before accessing it, or it may cause runtime errors. "@grafana/[email protected]" does not export member "locationSearchToObject"  @grafana/plugins/import-is-compatible

/Users/jackwestbrook/dev/grafana/scenes/packages/scenes/src/components/SceneRefreshPicker.test.ts
  6:10  warning  The member "config" is not available in all runtime environments that this plugin supports. Make sure to check if the member is undefined before accessing it, or it may cause runtime errors. "@grafana/[email protected]" does not export member "config"  @grafana/plugins/import-is-compatible

/Users/jackwestbrook/dev/grafana/scenes/packages/scenes/src/components/SceneRefreshPicker.tsx
  4:10  warning  The member "config" is not available in all runtime environments that this plugin supports. Make sure to check if the member is undefined before accessing it, or it may cause runtime errors. "@grafana/[email protected]" does not export member "config"  @grafana/plugins/import-is-compatible

...

What you expected to happen

For the package to download and the lint job to run successfully.

How to reproduce it (as minimally and precisely as possible)

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

N/A

Additional context

No response

Metadata

Metadata

Assignees

Labels

type/bugSomething isn't working

Type

Projects

Status

🧑‍💻 In development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions