Skip to content

TypeError: Cannot read properties of undefined (reading 'length'), error when using with vitest  #30

@chandu

Description

@chandu

Hi,
Thanks for this plugin.
I have been using this in one of my projects without any issuess untill recent past with vitest/vite.

However I have upgraded the plguin version from 7.0.1 to 7.1.1 and since then when I run the vitest run or vitest, I am getting the error TypeError: Cannot read properties of undefined (reading 'length'), (thrown in the resolveId call) and the process is exiting.

The same code is working fine with v 7.0.1 of this plugin.
I think the introduction of the 'order': 'pre' of the resolveId function could be triggering this. https://github.com/Septh/rollup-plugin-node-externals/blob/main/source/index.ts#L231

Stackblitz with v7.0.1 works fine: https://stackblitz.com/edit/vitest-dev-vitest-ydhtdg?file=package.json

Stackblitz with v7.1.1 fails: https://stackblitz.com/edit/vitest-dev-vitest-jlcazj?file=package.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions