After trying many different things, my deploy preview is still compiling into a blank page. I’m able to successfully deploy from GitHub to production, but not to deploy preview.
Link: https://deploy-preview-28--hungry-noyce-fb652c.netlify.app/
I’ve tried the recommended tricks of setting “homepage” in package.json to “.”, “./”, “”, and removing it all together.
netlify.toml:
[[redirects]]
from = “/*”
to = “/index.html”
status = 200
Any thoughts?
Hey @NicoleJaneway
I am not seeing a blank page
Curiously @NicoleJaneway, I now see the same blank page.
I see the scripts for the page a loading from www.datastrategypros.com
rather than the deploy preview URL.
Because of chunking, the main chunk (https://www.datastrategypros.com/static/js/main.493da4ce.chunk.js
) is returning a 404 because it only exists on the preview URL.
Okay great - so what is the next step?
I guess finding out why scripts are loading from www.datastrategypros.com
instead of from a path on preview domain e.g. /static/js/main.493da4ce.chunk.js
.
There is, I would suggest, something in the site configuration that is setting that base URL.
I’ve been looking into this and I still don’t get it. Not sure what setting I would edit to ensure deploys build correctly. There isn’t a “homepage” property in my json (there used to be, but I removed it), and that didn’t fix. Not sure what to change without taking down my site in prod.
Can you share the repository you are deploying from @NicoleJaneway
1 Like
It’s a private repo. I’ve already accidentally deployed my .env file
Maybe I can do a clean push to a separate repo for you to look at @coelmay?
Oops! Make sure to add .env*
to your .gitignore
If you can push non-sensitive code to a repository, happy to have a look at it for you.
((bump @coelmay. sorry to bother, but it’s really hard to develop in the dark.))
I believe my latest reply on your other thread is applicable here too.
^ Okay, that is some BS. I’m following all the instructions provided through the Netlify docs.
Is the next step to tear down my Netlify project and start from scratch?
I’m posting all the relevant links here so they’re in one place in case anyone the Netlify Pilot team is interested in saying something helpful about this:
Production deploy: (https://www.datastrategypros.com/).
Sample repo: https://github.com/NicoleJaneway/netlify-build
Sample deploy: https://deploy-preview-38–hungry-noyce-fb652c.netlify.app/ ← blank page
Note that there is no “homepage” property in my package.json, so an incorrect value here must not be my problem. I think there’s something in my Netlify settings that’s messed up (maybe even some property that I don’t have access to as a frontend user of the site), and I would like someone from Netlify to help or at least confirm this is not the case.
Hi @NicoleJaneway,
I checked that page, and @coelmay’s initial assertion seems to be correct. The files are not loading because they’re referencing the production URL.
Now, as the homepage doesn’t exist in the package.json
, does it exist in your .env
file by any chance? I checked your entire repo and it doesn’t seem to exist anywhere else that would be a problem.
The other problem is that, you’ve committed the build
folder to your repository. That folder includes the files from your previous build in which this problem existed. I tried building your site locally, and all the paths were relative (started with /
) - so there does seem to be something wrong with the files that you didn’t upload in the public repo OR the fact that the build folder exists in the repo.
1 Like
Hey @hrishikesh @coelmay . I’m having the same issue with my react app. The build and deployment checks go through but the deployed and preview pages are both blank with the following console errors. Adding and removing the homepage field to package.json didn’t help.
Here is the GitHub repo:
GitHub - samnjab/new-portfolio
The deployment history on netlify:
Netlify App
And the live link:
https://samjaberi.dev/
I’m relatively new to netlify, I’d appreciate your help with this.
We had this exact same problem - the script tag was pointing to a our production base URL, not the deploy preview URL. I found we had a PUBLIC_URL
env variable that was the same across production and deploy previews. Netlify
The answer here Netlify deployed with no errors, but page blank .HTTP2 error - #2 by nathanmartin referenced some create-react-app docs:
Create React App assumes your application is hosted at the serving web server’s root or a subpath as specified in package.json
(homepage
). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included)
Advanced Configuration | Create React App
Now we have that set to /
for our deploy previews - no more blank page!