TypeError: n(...).createContext is not a function
Unanswered
English Lop posted this in #help-forum
English LopOP
TypeError: n(...).createContext is not a function
at 34999 (/vercel/path0/.next/server/chunks/394.js:1:237056)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 98906 (/vercel/path0/.next/server/chunks/394.js:1:238823)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 99319 (/vercel/path0/.next/server/chunks/394.js:1:257215)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 42040 (/vercel/path0/.next/server/chunks/394.js:1:242556)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 13454 (/vercel/path0/.next/server/chunks/394.js:1:262501)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) {
digest: '3078100993'
"use client";
import { useSession } from "next-auth/react";
import { createContext, useContext, useEffect, useState } from "react";
export const ProductContext = createContext({
addProduct: () => {},
removeProduct: () => {},
getProduct: () => {},
addCustomization: () => {},
removeCustomization: () => {},
getSelectedCustomizations:() => {},
addToCheckout: () => {},
getCheckout: () => {},
quantity: 1,
setQuantity: () => {},
userLoggedIn: false,
showLoginModal: false,
setShowLoginModal: () => {},
getUser: () => {},
setUser: () => {},
});
can sombody please help me how to fix this issue. This is happening only in production while deploying. in local its working fine.
nextjs 14
react 18
react-dom 18
node 20
at 34999 (/vercel/path0/.next/server/chunks/394.js:1:237056)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 98906 (/vercel/path0/.next/server/chunks/394.js:1:238823)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 99319 (/vercel/path0/.next/server/chunks/394.js:1:257215)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 42040 (/vercel/path0/.next/server/chunks/394.js:1:242556)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143)
at 13454 (/vercel/path0/.next/server/chunks/394.js:1:262501)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:143) {
digest: '3078100993'
"use client";
import { useSession } from "next-auth/react";
import { createContext, useContext, useEffect, useState } from "react";
export const ProductContext = createContext({
addProduct: () => {},
removeProduct: () => {},
getProduct: () => {},
addCustomization: () => {},
removeCustomization: () => {},
getSelectedCustomizations:() => {},
addToCheckout: () => {},
getCheckout: () => {},
quantity: 1,
setQuantity: () => {},
userLoggedIn: false,
showLoginModal: false,
setShowLoginModal: () => {},
getUser: () => {},
setUser: () => {},
});
can sombody please help me how to fix this issue. This is happening only in production while deploying. in local its working fine.
nextjs 14
react 18
react-dom 18
node 20