Skip to content

401 unauthorized on /nextimg calls from a password protected build #553

Description

@kandizzy

When using next/image images fail to load if password protection is on.

Steps to reproduce the behavior:

  1. Deploy a site using next/image
  2. View the site with password protection on, receive a 401 Unauthorized on the call
  3. Turn password protection off, image will load

Expected behavior
Is there a way to pass the credentials through to functions?

Versions

  • Next.js: 11.0.1
  • plugin 3.7.1

If you're using file-based installation

  • netlify.toml:
[build]
  command = "rm -rf out && yarn build"
  publish = "out"

[functions]
  directory = "functions"
  node_bundler = "esbuild"
  external_node_modules = ["@netlify/functions", "image-type", "is-svg", "sharp"]

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

I am not sure if external_node_modules is necessary here, but using the CLI I had to add those modules to my package.json in order for netlify dev to load the images, this is on Mac OS 11.3, netlify-cli/4.4.2 darwin-arm64 node-v15.14.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions