Closed
Description
Describe the bug
Environment variable NEXT_IMAGE_ALLOWED_DOMAINS declared in netlify.toml for image handling is ignored. If it's declared in Netlify UI works fine.
or
gives a 403 error "Image is not from a permitted domain" ❌
no "Image is not from a permitted domain" error ✔
To Reproduce
Repository: https://github.com/Marcelo-Figueiredo/next-plugin-issue
Steps to reproduce the behavior:
- Create a new next app
- have a next/image component with
src="https://randomuser.me/api/portraits/men/75.jpg"
- Set the
NEXT_IMAGE_ALLOWED_DOMAINS = "randomuser.me"
variable in netlify.toml - Deploy to netlify with essential plugin (403 error)
- Set variables in Netlify UI
- Re-deploy (no 403 error)
Expected behavior
There should be no error if NEXT_IMAGE_ALLOWED_DOMAINS is declared in netlify.toml
Versions
- Next.js: 10.0.6
If you're using file-based installation
- netlify.toml:
[build]
command = "yarn build"
publish = "out"
[build.environment]
NEXT_IMAGE_ALLOWED_DOMAINS = "randomuser.me"
FORCE_WEBP_OUTPUT = "true"
NODE_VERSION = "12.18.2"
YARN_VERSION = "1.19.1"
NETLIFY_USE_YARN = "true"
Metadata
Metadata
Assignees
Labels
No labels