Skip to content

pg-connection-string v2.8.0 broke default export #3424

Closed
@hjr3

Description

@hjr3

@hjr3 just a heads up, 2.8.0 was technically a breaking change. Even though module.exports = parse still existed, it broke the default export:

import pgConnectionString from 'pg-connection-string';
       ^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module 'pg-connection-string' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:180:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:263:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)

Node.js v22.14.0

I'm guessing it's an ESM / bundler or whatever type error, but it's easy enough to fix and switch to import { parse } from 'pg-connection-string';

Originally posted by @ThisIsMissEm in #3421

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