Netlify Next.js images throw IPX Error 500

Yes, I’ve just tried and the issue persists. Here is the deploy that has the images throwing the discussed error:

Failed to load resource: the server responded with a status of 500 ()

CNG Lawyers - Home (62abc3c0ce19d452e0369bba–cng-lawyers.netlify.app)

C6A0F6

If anything else is needed or I can be of any assistance, I’m happy to help.

Thank you very much for that reproduction. We’ll run this by the engineers once again this week to ask about the updates.

Is this of any use to your team? We are having a similar issue and are unsure how to resolve it. (See IPX error here)

I have the same error.

This is the image defined in the HTML

   <Image
        src="/img/main.png"
        alt="background main"
        layout="fill"
        objectFit="cover"
        objectPosition="60% 30%"
        onLoadingComplete={() => setImageLoad(true)}
      />

I have this error in the network:

1. errorMessage: "Error: Cannot find module './utils'\nRequire stack:\n- /var/task/node_modules/unstorage/dist/drivers/fs.cjs\n- /var/task/node_modules/@netlify/ipx/dist/http.js\n- /var/task/node_modules/@netlify/ipx/dist/index.js\n- /var/task/.netlify/functions-internal/_ipx/_ipx.js\n- /var/task/_ipx.js\n- /var/runtime/UserFunction.js\n- /var/runtime/Runtime.js\n- /var/runtime/index.js"
2. errorType: "Runtime.ImportModuleError"

@hrishikesh And I also noticed that the svg file works fine and png is not working and showing the 500 error. FYI, thanks for the help.

Hey folks, just got a fix out with plugin v 4.9.2: Release plugin-nextjs: v4.9.2 · netlify/netlify-plugin-nextjs · GitHub . In it we protect against the cause of the problem, which was created in a dependency that was later fixed (unstorage - npm).

Please let us know if you cannot successfully use the new plugin version going forward!

Hi ser, thanks for the help! Got one question, when will this version can publish inside netlify plugins ?
Or I just need to do the settings inside my project manually ?

Hi, thanks for the reply!
Unfortunately, I just tested it out and it seems to not be working.
I also tried with a new project just to test it out, but same error.
I tried with 4.9.2 and 4.9.3 which is the latest currently available.
Title English (62b600cac1e6e800a252825a–dental-clinic-abel-martinez.netlify.app)
CNG Lawyers - Home (62b5e76a3f6bab29bf7dfe4b–cng-lawyers.netlify.app)

Did you try to clear cache and deploy? Also, you could try to deploy it on a new site.

I’ve just now tried with a brand new site created solely for this testing purpose:
Create Next App (62b8aaea17631275e598e6a0–testing-ipx-22-6-2022.netlify.app)
The issue is still the same unfortunately, this time using the plugin version 4.9.3 and building from cli with command netlify deploy --build --prod
The contents of my netlify.toml file are as follows:

[build]
  command = "npm run build"
  functions = "netlify/functions"
  publish = ".next"

[[plugins]]
  package = "@netlify/plugin-nextjs"

Hi @jorgebef,

Your error is not related to the problem that occurred a few days back. That was about an upstream dependency and your problem is the one that;s being discussed in this thread. You actually have a solution - deploy via Git or from a Linux-based machine.

@fool @hrishikesh this is still not resolved with @netlify/plugin-nextjs@4.41.3 when using "type": "module" (ESM) with Next.js projects, users talking about that over here:

This would eventually be resolved in the next Next.js Runtime.

Opt-in the Next.js Runtime v5 (@netlify/plugin-nextjs@5.0.0-rc.4) resolved the issue.

  1. Re-deploying your Next.js application on Netlify
  2. Opt-In to Next.js Runtime v5
    • After the re-deployment, navigate to the Deploys Section on Netlify
    • Look for the Opt-In button related to Next.js Runtime v5 and click it
  3. During the deployment, you may encounter a warning about outdated plugins
1:56:31 PM: ❯ Outdated plugins
1:56:31 PM:    - @netlify/plugin-nextjs@4.41.3: latest version is 5.0.0-rc.4
1:56:31 PM:      To upgrade this plugin, please uninstall and re-install it from the Netlify plugins directory (https://app.netlify.com/plugins)
  1. Remove and re-add Next.js Runtime under site configuration → Build & deploy → Build settings → Configure → Remove (next to Next.js) → Save → Configure → Select → Next.js

  2. Trigger another re-deployment and the @netlify/plugin-nextjs@5.0.0-rc.4 was added

1:58:59 PM: ❯ Installing plugins
1:58:59 PM:    - @netlify/plugin-nextjs@5.0.0-rc.4
1 Like