Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cannot import jsdom-worker with --experimental-vm-modules #22

Open
@Amatewasu

Description

@Amatewasu

In order to be allowed to useimport.meta.url in my jest tests, I turned on the option--experimental-vm-modules. But thereby I cannot import jsdom-worker anymore.

I have the following stack trace:

FAIL  src/anonymized-path/anonymized.test.tsx  ● Test suite failed to run                                                                                                                                                                  Must use import to load ES Module: C:\anonymized-path\anonymized\node_modules\node-fetch\src\index.js      4 | import { enableFetchMocks } from 'jest-fetch-mock';      5 | import { readFileSync, readdirSync } from 'fs';    > 6 | import 'jsdom-worker';        | ^      7 | import { getPathFromPublic } from 'utils/helpers';      8 |      9 | /* Wasm jest problems - the function locate file returns C:\ instead of localhost when testing with jest      at Runtime.requireModule (node_modules/jest-runtime/build/index.js:972:21)      at Object.<anonymous> (node_modules/jsdom-worker/dist/jsdom-worker.js:1:89)      at Object.<anonymous> (src/setupTests.ts:6:1)

Would you have insight how to solve this issue?

$ node -vv17.9.1$ npm -v8.11.0

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


      [8]ページ先頭

      ©2009-2026 Movatter.jp