Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module './image-optimizer' from serverless functions (12.0.11-canary.10) #34134

Closed
jakejarvis opened this issue Feb 9, 2022 · 3 comments · Fixed by #34141
Assignees
Labels
Output (export/standalone) Related to the the output option in `next.config.js`.

Comments

@jakejarvis
Copy link
Contributor

jakejarvis commented Feb 9, 2022

Run next info (available from version 12.0.8 and up)

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101
Binaries:
  Node: 16.13.2
  npm: 8.1.2
  Yarn: 1.22.17
  pnpm: N/A
Relevant packages:
  next: 12.0.11-canary.10
  react: 17.0.2
  react-dom: 17.0.2

What version of Next.js are you using?

12.0.11-canary.10

What version of Node.js are you using?

16.13.2 (14.x on Vercel)

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

After upgrading from 12.0.11-canary.9 to canary.10, I'm getting 500 errors from many of my serverless functions (and SSR pages) and this exception in the logs:

2022-02-09T16:23:26.321Z	undefined	ERROR	Uncaught Exception 	{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module './image-optimizer'
Require stack:
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.js
- /var/runtime/UserFunction.js
- /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module './image-optimizer'","Require stack:","- /var/task/node_modules/next/dist/server/next-server.js","- /var/task/___next_launcher.js","- /var/runtime/UserFunction.js","- /var/runtime/index.js","    at _loadUserApp (/var/runtime/UserFunction.js:202:13)","    at Object.module.exports.load (/var/runtime/UserFunction.js:242:17)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    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:76:12)","    at internal/main/run_main_module.js:17:47"]}
Unknown application error occurred
Runtime.ImportModuleError

I assume this has to do with #34075 ? I'm not doing any image processing in these functions but maybe I'm doing something else crazy and unsupported... Source code and logs are linked to below.

Thanks in advance!

Expected Behavior

No image-optimizer errors where images aren't being optimized would be my first thought, but not familiar enough with what's going on in #34075 to make a more educated guess... 😬

To Reproduce

My source code is public and a good example is at:

https://github.com/jakejarvis/jarv.is/blob/dependabot/npm_and_yarn/next-12.0.11-canary.10/pages/feed.xml.ts

I believe my Vercel logs are public too, if you try to request this page at: https://jarvis-git-dependabot-npmandyarnnext-12011-canary10-jakejarvis.vercel.app/feed.xml

...and view the logs at https://vercel.com/jakejarvis/jarvis/AG74op91Fv9CnaHZDeJETjvg8XtS/functions


edit: Forgot to add that I'm not getting this error locally with next dev, which makes sense but thought I should mention it.

@jakejarvis jakejarvis added the bug Issue was opened via the bug report template. label Feb 9, 2022
@ijjk ijjk added kind: bug Output (export/standalone) Related to the the output option in `next.config.js`. and removed bug Issue was opened via the bug report template. labels Feb 9, 2022
@ijjk ijjk self-assigned this Feb 9, 2022
@ijjk
Copy link
Member

ijjk commented Feb 9, 2022

Hi, this has been updated in v12.0.11-canary.11, please update and give it a try!

@jakejarvis
Copy link
Contributor Author

Back to normal, thanks so much @ijjk!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Output (export/standalone) Related to the the output option in `next.config.js`.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants