Replies: 11 comments 6 replies
-
To anyone potentially dealing with this (it's very likely just me, lol). This is a workaround I have atm: I have added a env variable to VERCEL's environments which basically only leverages the optimisation feature on PRODUCTION (when my WPEngine CMS will be live and not behind an authentication wall anyway).
|
Beta Was this translation helpful? Give feedback.
-
I was also facing the same error while using ghost cms as backend. but adding an environment variable works. |
Beta Was this translation helpful? Give feedback.
-
What kind of solution would you envision? Maybe you could set env variables like |
Beta Was this translation helpful? Give feedback.
-
If there's more interest in this we can probably solve it, please make sure to 👍 the initial message so that we can prioritize accordingly. |
Beta Was this translation helpful? Give feedback.
-
I am imagining an addition to next.config.js, something like:
And then you could use that when retrieving the image and passing along the auth setup. But like Tim said, best if there's enough interest. 👍 |
Beta Was this translation helpful? Give feedback.
-
This would be nice to have for my team too. We need to have two projects from the same repository, one connects with a test env behind basic auth and the other one connects to the production env. It would help to be able to measure the loading speed of the page on test. |
Beta Was this translation helpful? Give feedback.
-
hi, I am encountereing |
Beta Was this translation helpful? Give feedback.
-
Any update here? Need this as well Basic auth on images to be exact |
Beta Was this translation helpful? Give feedback.
-
i was facing the same issue although i am hosting my images on cloudinary and it does work if i use the normal
|
Beta Was this translation helpful? Give feedback.
-
As workaround, you can pass credentials in the url of image |
Beta Was this translation helpful? Give feedback.
-
Any update here? I need to fetch images with authorisation where image url expects bearer token to be passed. Basic auth on images to be exact. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
Describe the bug
Images loaded using the new
<Image />
comp are not loading when source is behind a Basic Auth. i.e. a Development Site on WPEngine.To Reproduce
My setup is that I am developing a Next.js site locally. And I'm pulling in site content from a Wordpress site (using WPGraphQL) which is running on WPEngine.
The site is a Development environment, meaning I have to access with Basic Authorization.
Images loaded in a normal
<img />
tag load fine. (localhost:3000 is already authorised).The response I get from Network panel says:
"url" parameter is valid but upstream response is invalid
Expected behavior
A way to pass in Basic Authorization to the header for loading and showing images using next/Image
Screenshots
Response Header:
If applicable, add screenshots to help explain your problem.
System information
Additional context
WPEngine is on a Development Environment, traffic allowed with Basic Authorization.
Images are loading fine with old school img tag e.g.
<img src="http://mywebsite.wpengine.com/wp-content/uploads/2020/10/star-wars-cockpit-51-960.jpg" />
Beta Was this translation helpful? Give feedback.
All reactions