Skip to content

Misconfigured package doesn't play well with Remix #236

@mikecousins

Description

@mikecousins

Describe the bug
The NPM package is misconfigured with regards to esm/cjs types and as such certain build tools like Remix will not build successfully.

To reproduce
Make a Remix app in SPA mode
Add launchdarkly-react-client-sdk
Build

Expected behavior
Should build successfully.

Logs

import { useFlags } from "launchdarkly-react-client-sdk";
         ^^^^^^^^
SyntaxError: Named export 'useFlags' not found. The requested module 'launchdarkly-react-client-sdk' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'launchdarkly-react-client-sdk';
const { useFlags } = pkg;

SDK version
3.0.10

Language version, developer tools

OS/platform
Mac or Windows.

Additional context

Recommended fixes:
https://publint.dev/launchdarkly-react-client-sdk@3.0.10

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