When using next/image images fail to load if password protection is on.
Steps to reproduce the behavior:
- Deploy a site using
next/image
- View the site with password protection on, receive a 401 Unauthorized on the call
- 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
[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
When using
next/imageimages fail to load if password protection is on.Steps to reproduce the behavior:
next/imageExpected behavior
Is there a way to pass the credentials through to functions?
Versions
If you're using file-based installation
I am not sure if
external_node_modulesis necessary here, but using the CLI I had to add those modules to my package.json in order fornetlify devto load the images, this is on Mac OS 11.3,netlify-cli/4.4.2 darwin-arm64 node-v15.14.0