Skip to content

[Feature]: expect library vite support #14428

Closed
@kkimdev

Description

@kkimdev

🚀 Feature Proposal

Currently expect library is unusable with vite:

| 11:34:12 PM [vite] warning: 
| ./.vite_generated/deps/expect.js
| 13064|            try {
| 13065|              const moduleUrl = (0, _url().pathToFileURL)(filePath);
| 13066|              const importedModule = await import(moduleUrl.href);
|    |                                                  ^
| 13067|              if (!applyInteropRequireDefault) {
| 13068|                return importedModule;
| The above dynamic import cannot be analyzed by Vite.
| See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
|   Plugin: vite:import-analysis
|   File: ./.vite_generated/deps/expect.js?v=bb9d55bc

Motivation

Both vite and expect are popular libraries. We use expect on our server side codebase, but can't on client side due to this issue.

Example

No response

Pitch

Because it's a fundamental limitation of expect codebase.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions