-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Built site fails when deployed to Amazon S3 in 2.9.0 and later #15151
Comments
Still fails in 2.11.0 |
Can you investigate more what's happening? gatsbyjs.org is working fine e.g. https://www.gatsbyjs.org/rhhdjd |
One thing that I do notice is that this error is in the same function as the previous one, Also here's a difference between the local site and S3: one of the json files from s3 is being sent as an octet stream. I wonder if that would be sufficient to break it? |
update: yes this indeed seems to be the issue. manually setting the content type on everything in i think the issue is this code
...which is not unreasonable, it just didnt break before if by chance the server wasnt setting the mime type correctly |
@KyleAMathews I'm having the exact same issue on production and it seems on Amazon S3/CloudFront its receiving my page-data.json with and on console I'm getting:
Any idea what might be the cause? |
also having this problem, anyone found a fix? |
@silviopaganini the fix is in the thread. change the MIME type of each |
@KyleAMathews could this be problem be avoided by changing
|
@gswirrl that's happening locally when you build and serve the files with |
OMG |
development environment fixes aside, is Gatsby's position that this is an environment issue or will there be thought putting into a gatsby solution? i think this kind of problem creates a higher barrier of entry for newcomers |
The expectation is currently that people’s servers would set the mime type to Checking the extension in addition to the mime type seems reasonable — would someone like to PR that in? |
I just created a PR that doesn't look at content type but tries to parse the json. This should fix your issues. |
@wardpeet woah. thats a much better idea than mine. thank you. 🙏 |
Hey, we just published |
@pieh confirmed fixed for me! 🎉 thank you! 👍 |
Our PWA is hosted in Azure websites and we can't upgrade Gatsby higher than 2.9.2 (since the page-data.json change). The issue occurs only after an app deployment (locally everything is fine). |
Seems like we fixed this bug 🎉 let's close 😄 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
Description
Site builds and serves successfully with
gatsby build && gatsby serve
, but when I copy the built files to an AWS S3 web bucket, the site generates 'resource missing' errors.(the same AWS bucket has served gatsby sites successfully in the past)
UPDATE: I believe rolling back in same project to
fixes the issue. 2.9.0 and later all have the problem)
Steps to reproduce
(1)
(2)
upload files to AWS S3 website-bucket
Expected result
Website should appear as it does from
gatsby serve
Actual result
The js does not run. Console shows errors:
According to the 'Network' tab of my browser, all files loaded successfully.
Environment
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) m3-7Y32 CPU @ 1.10GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.4.0/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 75.0.3770.100
npmPackages:
gatsby: ^2.10.4 => 2.10.4
gatsby-image: ^2.2.3 => 2.2.3
gatsby-plugin-manifest: ^2.2.0 => 2.2.0
gatsby-plugin-offline: ^2.2.0 => 2.2.0
gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
gatsby-plugin-sharp: ^2.2.1 => 2.2.1
gatsby-source-filesystem: ^2.1.0 => 2.1.0
gatsby-transformer-sharp: ^2.2.0 => 2.2.0
npmGlobalPackages:
gatsby-cli: 2.7.2
The text was updated successfully, but these errors were encountered: