Error: Command "npm run build" exited with 1
Hello! Im trying to implement my Next.js project on Cloudflare Pages.
While trying to do so, I encounter an error related to webpack, PayPal SDK and vercel(?).
I don´t really understand the log, so hopefully someone in here can help me out.
18:10:52.286 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/orders/ordersPatchRequest.js:9:20
18:10:52.286 ▲ Module not found: Can't resolve 'querystring'
18:10:52.287 ▲
18:10:52.287 ▲ https://nextjs.org/docs/messages/module-not-found
18:10:52.287 ▲
18:10:52.287 ▲ Import trace for requested module:
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/orders/lib.js
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/lib.js
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/index.js
18:10:52.287 ▲ ./app/api/checkout/route.tsx
18:10:52.287 ▲ ./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fcheckout%2Froute.tsx&page=%2Fapi%2Fcheckout%2Froute&appDirLoader=too_long_to_paste_in_here
18:10:52.288 ▲ > Build failed because of webpack errors
18:10:52.337 ▲ Error: Command "npm run build" exited with 1
18:10:52.422
18:10:52.423 ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
18:10:52.423 ⚡️ If you need help solving the issue, refer to the Vercel or Next.js documentation or their repositories.
18:10:52.286 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/orders/ordersPatchRequest.js:9:20
18:10:52.286 ▲ Module not found: Can't resolve 'querystring'
18:10:52.287 ▲
18:10:52.287 ▲ https://nextjs.org/docs/messages/module-not-found
18:10:52.287 ▲
18:10:52.287 ▲ Import trace for requested module:
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/orders/lib.js
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/lib/lib.js
18:10:52.287 ▲ ./node_modules/@paypal/checkout-server-sdk/index.js
18:10:52.287 ▲ ./app/api/checkout/route.tsx
18:10:52.287 ▲ ./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fcheckout%2Froute.tsx&page=%2Fapi%2Fcheckout%2Froute&appDirLoader=too_long_to_paste_in_here
18:10:52.288 ▲ > Build failed because of webpack errors
18:10:52.337 ▲ Error: Command "npm run build" exited with 1
18:10:52.422
18:10:52.423 ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
18:10:52.423 ⚡️ If you need help solving the issue, refer to the Vercel or Next.js documentation or their repositories.
0 Replies