rollup / plugins

🍣 The one-stop shop for official Rollup plugins
MIT License
3.65k stars 591 forks source link

pluginutils broken type; estree-walker has no exported member Node #182

Closed maxmilton closed 4 years ago

maxmilton commented 4 years ago

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.

shellscape commented 4 years ago

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

atomicpages commented 4 years ago

Fixed by 2ae08ebacaf9981252664d47e073dbac2a0447e7. Can you please publish 7.0.1?

shellscape commented 4 years ago

@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.

atomicpages commented 4 years ago

@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.

maxmilton commented 4 years ago

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

kimmikirino commented 3 years ago

Hi guys,

Is someone else getting errors from the new version?

image

maxmilton commented 3 years ago

It's probably a better idea to create a new issue and link back to old one rather than trying to necro a closed issue.