From b72f68b20f7f57eb0704186bc76ef5ecf701a18a Mon Sep 17 00:00:00 2001 From: Sam Brenner <106700075+sabrenner@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:12:40 -0400 Subject: [PATCH] add webpack5 for nextjs v9.5 (#3572) --- packages/datadog-plugin-next/test/index.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/datadog-plugin-next/test/index.spec.js b/packages/datadog-plugin-next/test/index.spec.js index 2634ad6c50f..05fbd2c6cfe 100644 --- a/packages/datadog-plugin-next/test/index.spec.js +++ b/packages/datadog-plugin-next/test/index.spec.js @@ -79,6 +79,12 @@ describe('Plugin', function () { delete pkg.workspaces + // builds fail for next.js 9.5 using node 14 due to webpack issues + // note that webpack version cannot be set in v9.5 in next.config.js so we do it here instead + // the link below highlights the initial support for webpack 5 (used to fix this issue) in next.js 9.5 + // https://nextjs.org/blog/next-9-5#webpack-5-support-beta + if (realVersion.startsWith('9')) pkg.resolutions = { webpack: '^5.0.0' } + writeFileSync(`${__dirname}/package.json`, JSON.stringify(pkg, null, 2)) // installing here for standalone purposes, copying `nodules` above was not generating the server file properly