Skip to content

Typescript errors when using node16 moduleResolution in tsconfig #616

@vio

Description

@vio

I encountered this error when I changed the tsconfig that runs over my vite.config.ts (which imports rollup-plugin-webpack-stats).

I changed {"module": "esnext", "moduleResolution": "bundler"} to {"module": "nodenext", "moduleResolution": "node16"} to make typescript use the node module resolution strategies for my node based tools.

When I made this change I began to get the following type-check error on the line that did webpackPlugin()

This expression is not callable.
Type 'typeof import("/Users/ben/projects/rollup-plugin-webpack-stats-typeerror/node_modules/rollup-plugin-webpack-stats/dist/index")' has no call signatures.
I've created a reproduction demo for you at https://github.com/BPScott/rollup-plugin-webpack-stats-typeerror

Clone the repo, and then run npm run type-check to run tsc and see the errors.

rel: #605 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions