Skip to content

need help building example, esmregister + esmock #788

@iambumblehead

Description

@iambumblehead

When trying to create an example test with swc and esmock, this error occurs around the types definition file,

node --import @swc-node/register/esm-register --test esmock.node-swc.test.ts

> test:current
> node --import @swc-node/register/esm-register --test esmock.node-swc.test.ts

file:///home/bumble/soft/esmock/src/esmock.d.ts:1
type MockMap = { [specifier: string]: any }
     ^^^^^^^

SyntaxError: Unexpected identifier 'MockMap'
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:169:18)
    at callTranslator (node:internal/modules/esm/loader:272:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)

Thanks in advance for any advice

Metadata

Metadata

Assignees

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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy