You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These warnings show when building a nextjs app (v14), with npm, pnpm, and bun on a docker container (nextjs detects it as "edge", so it shows the messages).
home:build: ../../node_modules/scheduler/cjs/scheduler.production.min.js
home:build: A Node.js API is used (MessageChannel at line: 14) which is not supported in the Edge Runtime.
home:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
home:build:
home:build: Import trace for requested module:
home:build: ../../node_modules/scheduler/cjs/scheduler.production.min.js
home:build: ../../node_modules/scheduler/index.js
home:build: ../../node_modules/react-dom/cjs/react-dom.production.min.js
home:build: ../../node_modules/react-dom/index.js
home:build: ../../node_modules/sonner/dist/index.mjs
home:build: ../../packages/utilities/src/getToken.ts
home:build: ../../packages/utilities/index.ts
I'm trying to replicate the bug in an independent project, but I can't find how. However, if it helps, I will leave here the getToken() code, where this error is showing according to the stacktrace.
import{toast}from'sonner';import{isClient}from'./utils';import{useSessionStore}from'global-stores';importtype{GetTokenParams}from'./interface';exportconstgetToken=async(params?: GetTokenParams): Promise<string>=>{const{ avoidRedirect =false, ignoreCurrentAT =false}=params??{};lettoken: string|null=null;// Token is available on client side storeif(isClient()&&!ignoreCurrentAT){token=useSessionStore.getState().accessToken;}// Refresh token (Client side)if(isClient()&&!token){try{token=(awaitfetchTokenClient()).token;}catch(e){if(avoidRedirect)return'';console.error('⚠️ Error fetching token, will redirect.',e);toast.error('Necesita volver a iniciar sesión');constcurrentLocation=window.location.pathname;setTimeout(()=>{window.location.href=`/auth${currentLocation!=='/' ? `?redirectTo=${currentLocation}` : ''}`;},2000);}}// Refresh token (Server side)if(!isClient()&&!token){try{token=(awaitfetchTokenServer(ignoreCurrentAT)).token;}catch(e){console.error('⚠️ Error fetching token',e);}}returntoken??'';};
The text was updated successfully, but these errors were encountered:
home:build: ../../node_modules/scheduler/cjs/scheduler.production.min.js
home:build: A Node.js API is used (setImmediate at line: 11) which is not supported in the Edge Runtime.
home:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Describe the feature / bug 📝:
These warnings show when building a nextjs app (v14), with npm, pnpm, and bun on a docker container (nextjs detects it as "edge", so it shows the messages).
I'm trying to replicate the bug in an independent project, but I can't find how. However, if it helps, I will leave here the
getToken()
code, where this error is showing according to the stacktrace.The text was updated successfully, but these errors were encountered: