Skip to content

peterbrczan/primer-next-crypto-issue

Repository files navigation

Primer Next Crypto Issue

TL;DR

This is a sample project for demonstrating the ReferenceError: crypto is not defined issue which happens during a build for projects those us Gatsby or Next.js for SSR and the installed @primer-io/checkout-web package's version is above > 2.x.

Getting Started

Install the dependencies

npm install

Dev server (optional)

Start the dev server

npm run dev

When it's up and ready you can access the sample project on the http://localhost:3000. The root page was generated by the framework itself, the checkout page by us. You can access that on http://localhost:3000/checkout.

Build (where the issue happens)

Build the project

npm run build

After a short period of time, the build is going to fail with the error message: ReferenceError: crypto is not defined.

Workarounds

In the next.config.js file I tried to come up with some workarounds, but yet none of the worked.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published