Skip to content

Dynamic import returns double-nested default for @databases/split-sql-query #255

Open
@geelen

Description

Using "@databases/split-sql-query": "^1.0.3",:

❯ node
Welcome to Node.js v18.3.0.
Type ".help" for more information.
> splitExports = await import('@databases/split-sql-query')
[Module: null prototype] {
  __esModule: true,
  default: {
    hasValues: [Function: hasValues],
    hasSemicolonBeforeEnd: [Function: hasSemicolonBeforeEnd],
    default: [Function: splitSqlQuery]
  },
  hasSemicolonBeforeEnd: [Function: hasSemicolonBeforeEnd],
  hasValues: [Function: hasValues]
}

I've been working on https://github.com/geelen/npx-import and experimenting with dynamically installing & loading modules like this, but never seen a doubly nested default export like this. I know this kind of CJS/ESM interop can be kinda weird to debug, so this issue is more of an FYI more than anything. But thought you might want to know...

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