Skip to content

React Component not working with NextJS #71

@mbillz

Description

@mbillz

Describe the bug

I'm getting an import error when using the Google Pay React component with any NextJS projects. I've tried with both a fresh project as well as my company's web project.

To Reproduce

  1. Setup blank Typescript enabled NextJS project (npx create-next-app, rename file to pages/index.tsx and install necessary dependencies when prompted).
  2. npm install Google Pay React Button and include on page
  3. See error thrown

Expected behavior

Expect Google Pay Button to render

Screenshots

Screen Shot 2021-02-05 at 3 22 18 PM

Component information:

  • Component
    • React component (@google-pay/button-react)
  • Component version 2.1.5

Environment:

  • Device: MacBook Pro 15-inch, 2019
  • OS: Mac OS 10.15.7
  • Browser: Chrome 88.0.4324.146
  • Country/region: US

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions