Skip to content

import syntax / No matching export / cloudflare problem? #1001

@dcsan

Description

@dcsan

what is the correct import syntax?

1 import { debug } from 'debug';
or
2 import debug from 'debug';

i've been using (1) but just added to a cloudflare project and getting the error below using (1) where (2) works.

this is a cloudflare project so not sure if their runtime mangles things using 'wrangler'
https://developers.cloudflare.com/workers/wrangler/

 ⛅️ wrangler 4.6.0 (update available 4.19.1)
------------------------------------------------------

✘ [ERROR] Build failed with 1 error:

  ✘ [ERROR] No matching export in
  "../node_modules/.pnpm/unenv@2.0.0-rc.15/node_modules/unenv/dist/runtime/npm/debug.mjs" for import
  "debug"

      ../src/utils/Clogger.ts:4:9:
        4 │ import { debug } from 'debug';
          ╵          ~~~~~

update: this works:

import debug from 'debug';

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