Plugins: pluginutils broken type; estree-walker has no exported member Node

Created on 26 Jan 2020  ·  5Comments  ·  Source: rollup/plugins

  • Rollup Plugin Name: @rollup/pluginutils
  • Rollup Plugin Version: 3.0.5
  • Rollup Version: 1.29.1
  • Operating System (or Browser): Arch Linux
  • Node Version: 13.7.0

How Do We Reproduce?

  1. Import any method from @rollup/pluginutils in a TypeScript project
  2. Attempt to build the project

See minimal repro: https://github.com/MaxMilton/repro-rollup-plugin-utils-types

Expected Behavior

Project builds without type errors.

Actual Behavior

Type error is thrown due to missing type. estree-walker does not actually have any Node type exported.

❯ yarn run build
yarn run v1.21.1
$ tsc index.ts
node_modules/@rollup/pluginutils/types/index.d.ts:1:10 - error TS2305: Module '"../../../estree-walker/types"' has no exported member 'Node'.

1 import { Node } from 'estree-walker';
           ~~~~


Found 1 error.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Changing pluginutils/types/index.d.ts from...

import { Node } from 'estree-walker';

... to...

import { Node } from 'estree';

... resolves the issue.

c³ ⋅ PR welcome s⁵ 💧💧 inconvenient

All 5 comments

We'd be happy to review a PR that resolves this.

Fixed by 2ae08ebacaf9981252664d47e073dbac2a0447e7. Can you please publish 7.0.1?

@atomicpages thanks for referencing the commit, but please don't ask for package publishes. It adds to the noise and isn't necessary. All plugin packages are published as we have time.

@shellscape it's definitely _not_ noise. It's blocking if you use tsc and you depend on this package -- the build fails because of a bad type check.

Thanks for the quick feedback guys and thanks @NotWoods for the fix and improvements! :trophy:

Was this page helpful?
0 / 5 - 0 ratings