Skip to content

Problem with import lodash #507

@pionxzh

Description

@pionxzh

Describe the bug

After upgrate to v0.0.141, I found that import { isString } from 'lodash' will get isString === undefined
and I try to check and debug the code, looks like this issue was introduced by the fix of #479

Minimal reproduction code:

import { expect, test, assert } from 'vitest';
import { isString } from 'lodash';

test('lodash', () => {
  expect(typeof isString).toBe('function');
});

Reproduction

https://stackblitz.com/edit/vitest-lodash-issue?devtoolsheight=33&file=test/basic.test.ts

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 12.70 GB / 31.89 GB
  Binaries:
    Node: 14.17.5 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.55)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    @vitejs/plugin-legacy: ^1.6.4 => 1.6.4
    @vitejs/plugin-vue: ^2.0.0 => 2.0.0
    vite: ~2.7.10 => 2.7.10
    vitest: 0.0.141 => 0.0.141

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions