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
// If "use client" directive has been added to the top of the file, then we can ignore the warnings related to it
23
+
if(useClientBanner){
24
+
if(
25
+
// vite-plugin-react also ignores this warning - https://github.com/vitejs/vite-plugin-react/blob/3748fc7493cf0a07a2ae275fbd1ae035f01010cc/packages/plugin-react/src/index.ts#L307-L323
26
+
warning.code==='MODULE_LEVEL_DIRECTIVE'&&
27
+
warning.message.includes('use client')
28
+
){
29
+
return
30
+
}
31
+
// It comes due to use client directive being ignored in the middle of the file
32
+
// Even though this could happen in other cases, but there would always be another corresponding error logged which could still highlight any issue during build
33
+
if(warning.message?.includes("Can't resolve original location of error")){
34
+
return
35
+
}
36
+
}
37
+
defaultHandler(warning)
38
+
},
21
39
output: {
22
40
exports: "named",
41
+
// Add "use client" directive to the top of the bundle for Next.js App Router compatibility
42
+
// During bundling "use client" directive comes in b/w the file which is ignored/removed by Rollup because it makes sense at the top only
43
+
banner: useClientBanner,
23
44
// Provide global variables to use in the UMD build
0 commit comments