-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency error: ReferenceError: self is not defined
for qr-code-styling
#39
Comments
Thanks for the report, Next.js is really important to support. Do you happen to have a repo that reproduces the issue? Happy to take a look. |
Yeah, just made one: https://github.com/kb24x7/solana-pay-next |
Ah, I see the issue. I had to use this for Jest to run the tests: https://github.com/solana-labs/solana-pay/blob/d7e21ab3da5ac1ed110ba48375e0800a0fc4f8d5/core/jest.config.json#L3 I think the issue is that the QR code library accesses this, https://developer.mozilla.org/en-US/docs/Web/API/Window/self, probably to make UMD build. While this workaround is an option, disabling SSR is kind of a drag. If that library is no longer maintained, we should fork it and fix this. |
Great! Thanks for the quick fix, actually I did make myself a fork as well 😄 |
Help please with this problem 😥 |
import through next/dynamic |
Dependency (
qr-code-styling
) error while trying to use the package in Next.js@12.0.0It's the same even if I only use the
encodeURL
method.Linking to a issue and PR for this error in their repository:
kozakdenys/qr-code-styling#38
kozakdenys/qr-code-styling#64
The text was updated successfully, but these errors were encountered: