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
{{ message }}
Repository navigation
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #5478
Hey thanks for writing in. That looks like a problem we should fix. To help us debug, could you tell us your next + webpack version, and show us your next.config.js file?
@AbhiPrasad updated to the above and seems to be building now in production. Not sure what changed between today and yesterday (tried reverting back to 7.7.0 first to make sure and it also failed with same error). Could be that Next updated their 16.x node version which might have had some breaking changes potentially?
@wadehammes - glad to hear it's working now! I can see what's failing (and will add a safety check around it), and indeed, there was a change released in 7.8.0 which touches that code path. The fact that it was still erroring when you reverted to 7.7.0 is very curious, though, and obv would mean the change in question wasn't the cause. When you did that, had you already made the withSentryConfig change?
@vip30 - Can you also please share your nextjs version and next.config.js code? Also, can you similarly try reverting to 7.7.0 to see if the error still happens there, as was the case for @wadehammes?
@lobsterkatie@AbhiPrasad the new withSentryConfig setup is working great but now our hero Lottie won't load (but only on the home page weirdly) due to the baggage header. Trying to figure out why only this asset won't load but not all the others.
@wadehammes - glad to hear it's working now! I can see what's failing (and will add a safety check around it), and indeed, there was a change released in 7.8.0 which touches that code path. The fact that it was still erroring when you reverted to 7.7.0 is very curious, though, and obv would mean the change in question wasn't the cause. When you did that, had you already made the withSentryConfig change?
@vip30 - Can you also please share your nextjs version and next.config.js code? Also, can you similarly try reverting to 7.7.0 to see if the error still happens there, as was the case for @wadehammes?
I had not updated to the withSentryConfig yet, I wanted to determine if 7.8.0 was the cause. It could have been a caching issue with Vercel though potentially?
@wadehammes - glad to hear it's working now! I can see what's failing (and will add a safety check around it), and indeed, there was a change released in 7.8.0 which touches that code path. The fact that it was still erroring when you reverted to 7.7.0 is very curious, though, and obv would mean the change in question wasn't the cause. When you did that, had you already made the withSentryConfig change? @vip30 - Can you also please share your nextjs version and next.config.js code? Also, can you similarly try reverting to 7.7.0 to see if the error still happens there, as was the case for @wadehammes?
I had not updated to the withSentryConfig yet, I wanted to determine if 7.8.0 was the cause. It could have been a caching issue with Vercel though potentially?
Maybe? Though I've never seen that happen, even when deploying slightly different versions of the SDK over and over again in rapid succession (as I did more times than I can count when building the SDK!). Might just be gremlins...
As for the baggage header, is that problem new with 7.8.0 as well? And do the assets which load successfully also come from assets.ctfassets.net, or only the failing one?
@wadehammes - glad to hear it's working now! I can see what's failing (and will add a safety check around it), and indeed, there was a change released in 7.8.0 which touches that code path. The fact that it was still erroring when you reverted to 7.7.0 is very curious, though, and obv would mean the change in question wasn't the cause. When you did that, had you already made the withSentryConfig change?
@vip30 - Can you also please share your nextjs version and next.config.js code? Also, can you similarly try reverting to 7.7.0 to see if the error still happens there, as was the case for @wadehammes?
Here is the nextjs config and yes 7.7.0 is working, just not working in 7.8.0
constpath=require("path");constrelayConfig=require("./relay.config");constWebpackAliyunOssPlugin=require("webpack-aliyun-oss");constwithInterceptStdout=require("next-intercept-stdout");constwithPWA=require("next-pwa");const{ withSentryConfig }=require("@sentry/nextjs");// Get environment variablesconstcdnHost=process.env.OSS_HOST;constenvSlug=process.env.ENV_SLUG;constsiteUrl=process.env.NEXT_PUBLIC_SITE_URL;constuseCDN=process.env.USE_CDN==="true";constuseSourceMap=process.env.USE_SOURCE_MAP==="true";constoss={bucket: process.env.OSS_BUCKET_NAME||"",keyId: process.env.OSS_ACCESS_KEY_ID||"",keySecret: process.env.OSS_ACCESS_KEY_SECRET||"",region: process.env.OSS_REGION||"",};/** @type {import('next').NextConfig} */letnextConfig={assetPrefix: useCDN ? `https://${cdnHost}/${envSlug}` : "",compiler: {emotion: true,relay: relayConfig,reactRemoveProperties: false,},experimental: {runtime: "experimental-edge",serverComponents: true,esmExternals: "loose",},pageExtensions: ["page.tsx","page.ts","page.jsx","page.js"],productionBrowserSourceMaps: useSourceMap,useFileSystemPublicRoutes: false,images: {domains: ["cdn.i-scmp.com","img.i-scmp.com"],},swcMinify: true,reactStrictMode: true,sentry: {disableServerWebpackPlugin: process.env.SENTRY_DISABLE_WEBPACK_PLUGIN==="true",disableClientWebpackPlugin: process.env.SENTRY_DISABLE_WEBPACK_PLUGIN==="true",},webpack: (config,{ dev, isServer, webpack })=>{// Set alias in webpackconfig.resolve.alias={
...config.resolve.alias,"~": __dirname,};// add svg loaderconfig.module.rules.push({test: /\.svg$/i,issuer: /\.[jt]sx?$/,use: [{loader: "@svgr/webpack",options: {svgoConfig: {plugins: [{name: "removeViewBox",active: false,},],},},},],});if(!isServer){useCDN&&config.plugins.push(newWebpackAliyunOssPlugin({from: [".next/static/**","public/sw.**"],accessKeyId: oss.keyId,accessKeySecret: oss.keySecret,bucket: oss.bucket,region: oss.region,overwrite: true,setOssPath(filePath){// Need to replace the path from ${pwd}/.next to _next/// ref: https://nextjs.org/docs/api-reference/next.config.js/cdn-support-with-asset-prefixreturn`/${envSlug}/${filePath.replace(path.join(process.cwd(),"public"),"public").replace(path.join(process.cwd(),".next"),"_next")}`;},setHeaders(){return{"Access-Control-Allow-Origin": siteUrl,Vary: "Origin, Access-Control-Request-Headers, Access-Control-Request-Method","Cache-Control": "max-age=31536000",};},}),);// Replace existing vendor config// ref: https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L760if(!dev){config.optimization.splitChunks.cacheGroups.lib.test=module=>{return/node_modules[/\\]/.test(module.nameForCondition()||"");};config.optimization.splitChunks.cacheGroups.lib.name=module=>{constpackageName=module.nameForCondition().match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];return`yarn.${packageName.replaceAll("@","")}`;};}// Ensures no server modules are included on the client.config.plugins.push(newwebpack.IgnorePlugin({resourceRegExp: /@*.\.server$/}));}returnconfig;},};// For removing duplicate atom key in the server stdout// ref: https://github.com/facebookexperimental/Recoil/issues/733#issuecomment-729255961nextConfig=withInterceptStdout(nextConfig,text=>text.includes("Duplicate atom key") ? "" : text,);nextConfig=withPWA({
...nextConfig,pwa: {dest: "public",disable: process.env.NODE_ENV!=="production",swSrc: "lib/service-worker/index.ts",},});module.exports=withSentryConfig(nextConfig,{release: process.env.NEXT_PUBLIC_COMMIT_SHA,});
Activity
AbhiPrasad commentedon Jul 27, 2022
Hey thanks for writing in. That looks like a problem we should fix. To help us debug, could you tell us your next + webpack version, and show us your
next.config.jsfile?wadehammes commentedon Jul 28, 2022
Next 12.1.6 (the webpack version bundled with that)
@AbhiPrasad
AbhiPrasad commentedon Jul 28, 2022
Why are you using the sentry
WebpackPluginstand-alone? UsingwithSentryConfigas per https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#extend-nextjs-configuration is what we recommend (it’ll include the webpack plug-in under the hood automatically)wadehammes commentedon Jul 28, 2022
@AbhiPrasad trying this now, this is old code so a refactor is always appreciated. I'll let you know results here soon.
vip30 commentedon Jul 28, 2022
I'm using withSentryConfig and facing the same issue as well
wadehammes commentedon Jul 28, 2022
@AbhiPrasad updated to the above and seems to be building now in production. Not sure what changed between today and yesterday (tried reverting back to 7.7.0 first to make sure and it also failed with same error). Could be that Next updated their 16.x node version which might have had some breaking changes potentially?
lobsterkatie commentedon Jul 28, 2022
@wadehammes - glad to hear it's working now! I can see what's failing (and will add a safety check around it), and indeed, there was a change released in 7.8.0 which touches that code path. The fact that it was still erroring when you reverted to 7.7.0 is very curious, though, and obv would mean the change in question wasn't the cause. When you did that, had you already made the
withSentryConfigchange?@vip30 - Can you also please share your nextjs version and
next.config.jscode? Also, can you similarly try reverting to 7.7.0 to see if the error still happens there, as was the case for @wadehammes?wadehammes commentedon Jul 28, 2022
@lobsterkatie @AbhiPrasad the new
withSentryConfigsetup is working great but now our hero Lottie won't load (but only on the home page weirdly) due to thebaggageheader. Trying to figure out why only this asset won't load but not all the others.https://www.gotrhythm.com/
wadehammes commentedon Jul 28, 2022
I had not updated to the
withSentryConfigyet, I wanted to determine if 7.8.0 was the cause. It could have been a caching issue with Vercel though potentially?wadehammes commentedon Jul 28, 2022
Even weirder, the asset in question loads on our staging url (NextJS Preview env) which is the exact same release as production right now.
lobsterkatie commentedon Jul 28, 2022
Maybe? Though I've never seen that happen, even when deploying slightly different versions of the SDK over and over again in rapid succession (as I did more times than I can count when building the SDK!). Might just be gremlins...
As for the
baggageheader, is that problem new with 7.8.0 as well? And do the assets which load successfully also come fromassets.ctfassets.net, or only the failing one?wadehammes commentedon Jul 28, 2022
@lobsterkatie yes all assets are from Contentful's asset CDN. For example, https://www.gotrhythm.com/plans-overview
lobsterkatie commentedon Jul 28, 2022
That is indeed strange. And does this also happen with 7.7.0, or no?
wadehammes commentedon Jul 28, 2022
@lobsterkatie actually this is 7.7.0 right now, let me try 7.8.0 now
wadehammes commentedon Jul 28, 2022
That actually was 7.8.0 😅 sorry it's too late for me to be working
wadehammes commentedon Jul 28, 2022
Updated some CORS headers on my end in my next.config and seem to have resolved it. Looking forward to the patch above!
vip30 commentedon Jul 28, 2022
Here is the nextjs config and yes 7.7.0 is working, just not working in 7.8.0
fix(nextjs): Add default `distDir` value back into `index.server.ts` (#…
fix(sentry): resolve __dirname error in Edge Runtime