1

I’m having problems with a deploy on Netlify. The Next.js projects builds and deploy correctly except from one part that uses feed package, when I try to access to feed it always throws this error:

Runtime.ImportModuleError: Error: Cannot find module 'esbuild'
Require stack:
- /var/task/.netlify/functions-internal/next_feeds_atomxml/nextPage/chunks/708.js
- /var/task/.netlify/functions-internal/next_feeds_atomxml/nextPage/webpack-runtime.js
- /var/task/.netlify/functions-internal/next_feeds_atomxml/nextPage/pages/feeds/atom.xml.js
- /var/task/.netlify/functions-internal/next_feeds_atomxml/next_feeds_atomxml.js
- /var/task/next_feeds_atomxml.js
- /var/runtime/UserFunction.js
- /var/runtime/Runtime.js
- /var/runtime/index.js
 at _loadUserApp (/var/runtime/UserFunction.js:221:13)
 at Object.module.exports.load (/var/runtime/UserFunction.js:279:17)
 at Object.<anonymous> (/var/runtime/index.js:43:34)
 at Module._compile (internal/modules/cjs/loader.js:1085:14)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
 at Module.load (internal/modules/cjs/loader.js:950:32)
 at Function.Module._load (internal/modules/cjs/loader.js:790:12)
 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
 at internal/main/run_main_module.js:17:47

The project uses Next.js 12.1.0

You can see error here: https://free.law/feeds/atom.xml

This the repo: https://github.com/freelawproject/free.law the deploy above is from main branch

I also tried to deploy to another site with fix-rss branch here: https://deploy-preview-84--cozy-raindrop-954cef.netlify.app/feeds/all.atom.xml (I changed atom url in this branch) Here doesn’t throw the error but my feed is empty instead of display the read mdx files from posts folder.

The feed works correctly on local, also loads the post on the feed correctly.

I'm not an next.js expert but I've reseached a lot but haven't found a solution.

asked Jun 24, 2022 at 16:24

1 Answer 1

2

You're most likely using v3 of @netlify/plugin-nextjs. This is no longer maintained or supported. You should upgrade to v4 to solve the issue. Read the migration guide here: https://github.com/netlify/netlify-plugin-nextjs#migrating-from-an-older-version-of-the-plugin

answered Jun 26, 2022 at 13:48
Sign up to request clarification or add additional context in comments.

1 Comment

Make sure it is a part of ur dependencies and not devDependencies

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.