Skip to content

ReferenceError: exports is not definedΒ #768

Open
@Zorig

Description

@Zorig

Summary:

i am using react-modal 3.9.1 with typescript: 3.3.3 with nextjs 9 and when importing ReactModal it is giving me an error saying "ReferenceError: exports is not defined" i also used @types/react-modal:3.8.2. on a sandbox it is working without issue though. But still there is error saying Module '"/sandbox/node_modules/@types/react-modal/index"' has no default export.ts(1192)

  1 | "use strict";
  2 | 
> 3 | Object.defineProperty(exports, "__esModule", {
  4 |   value: true
  5 | });
  6 | exports.bodyOpenClassName = exports.portalClassName = undefined;

Steps to reproduce:

  1. Install React-modal latest veersion on react typescript project
  2. Import ReactModal from 'react-modal'
  3. Call <ReactModal> in render method

Expected behavior:

should work without issue

Link to example of issue:

https://codesandbox.io/embed/tender-leavitt-260ul

Additional notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions