Skip to content

ERR_MODULE_NOT_FOUND during Vitest/ESM resolution due to missing .js extension #79

@0xf965

Description

@0xf965

Module resolution for the wallet-svelte-component library fails when run in strict Node.js environments (like Vitest tests). This is due to a missing file extension on a relative internal import in the package's distribution.

Location of Error

The error originates from node_modules/wallet-svelte-component/dist/index.js when attempting to import:

// Problematic import found in index.js:
import ... from './wallet/wallet-manager'; 

Proposed Fix

In strict ESM mode, the import must include the extension:

import ... from './wallet/wallet-manager.js';

Error Output

Error: Cannot find module '.../node_modules/wallet-svelte-component/dist/wallet/wallet-manager' imported from .../node_modules/wallet-svelte-component/dist/index.js
Serialized Error: { code: 'ERR_MODULE_NOT_FOUND', url: 'file:///.../dist/wallet/wallet-manager' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    MediumbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions