React 19.2.8 and [email protected] examples are not working

I am using React 19.2.8 and [email protected] and it is not finding payment form.

I am using the react code from the sample on

turkeyshootform.jsx:4 Uncaught SyntaxError: The requested module ‘/node_modules/.vite/deps/react-square-web-payments-sdk.js?v=b7dd10de’ does not provide an export named ‘PaymentForm’ (at turkeyshootform.jsx:4:10)

turkeyshootform.jsx:4 Uncaught SyntaxError: The requested module ‘/node_modules/.vite/deps/react-square-web-payments-sdk.js?v=b7dd10de’ does not provide an export named ‘CreditCard’ (at turkeyshootform.jsx:4:10)

Welcome to the Developer Forum!

This error usually comes from a stale Vite pre-bundle cache, not from React 19. Try:

  1. Stop the dev server, delete node_modules/.vite, then run npx vite --force (or npm run dev -- --force)
  2. Run npm ls react-square-web-payments-sdk to confirm 3.3.0 is the version that actually resolved
  3. Keep the named imports: import { PaymentForm, CreditCard } from 'react-square-web-payments-sdk';

If it still fails, please share your package.json and vite.config.js. Please remove any access tokens or other secrets before sharing.

Thank you. This fixed my problem. I sure wish this was in the forums. I wasted a lot of time trying to find a solution before contacting you.