When accessing my Next.js app from 127.0.0.1:8082
or localhost:8082
, everything runs smoothly. However, if I try to access it using my machine's IP address (e.g. http://10.233.xx.xx:8082/
), an error is thrown stating
Error: no native implementation of WebCrypto is available in current context
.
The root cause of this error seems to be in the following code snippet:
> const session = require("iron-session/edge");
const cookieSet = {
cookieName: "cookiename",
password: "mypass",
cookieOptions: {
sameSite: "strict",
maxAge: 3600,
secure: process.env.NODE_ENV === "production",
},
};