Skip to content

Import Popper from /dist instead of /lib #329

@sorahn

Description

@sorahn

Running jest with react-popper@0.9.2:

Steps to reproduce the problem

  1. Create new application (create-react-app)
  2. Add react-bootstrap-typeahead (includes react-popper)
  3. Add <Typeahead options={[]} /> to App.js
  4. Run yarn test

What is the expected behavior?

Test Passes

What went wrong?

 FAIL  src/App.test.js
  ● Test suite failed to run

    /Users/darylr/Github/popper-test/node_modules/react-popper/lib/Popper.js:13
    import { Component, createElement } from 'react';
    ^^^^^^

    SyntaxError: Unexpected token import

      at new Script (vm.js:51:7)
      at Object.<anonymous> (node_modules/react-bootstrap-typeahead/lib/Overlay.react.js:31:15)

Any other comments?

from my yarn.lock file:

react-bootstrap-typeahead@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/react-bootstrap-typeahead/-/react-bootstrap-typeahead-3.0.0.tgz#33af5b08015e22f094cc205a87dffd36ec251777"
  dependencies:
    classnames "^2.2.0"
    escape-string-regexp "^1.0.5"
    invariant "^2.2.1"
    lodash "^4.17.2"
    prop-types "^15.5.8"
    prop-types-extra "^1.0.1"
    react-onclickoutside "^6.1.1"
    react-overlays "^0.8.1"
    react-popper "^0.9.0"
    warning "^3.0.0"

react-popper@^0.9.0:
  version "0.9.2"
  resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-0.9.2.tgz#27a198e421e45e53261734dca28c6e57dd2c1604"
  dependencies:
    popper.js "^1.14.1"
    prop-types "^15.6.1"

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