Comments (9)
@benkraus We currently calculate the content type of static files with the help of the mime package.
Since apple-app-site-association
has no file extension the lookup fails to detect the correct mime type here.
As a workaround you could use a rewrite rule instead:
- Rename the file
public/apple-app-site-association -> public/apple-app-site-association.json
(Content type should then be set correctly by mime package) - Add a rewrite rule to your
next.config.js
:module.exports = { ... + async rewrites() { + return [ + { + source: '/apple-app-site-association', + destination: '/apple-app-site-association.json', + }, + ] + } }
from terraform-aws-next-js.
Nice, that worked great, thanks!
from terraform-aws-next-js.
Yeah, I'm needing this to change the header for the apple-app-site-association
file (it needs to have a content type of application/json). Anyone know of any other workaround for now?
from terraform-aws-next-js.
Hey @ofhouse 👋,
Is this feature still on the road map?
Would be fantastic to be able to use this feature
from terraform-aws-next-js.
I lied - I had an old cached version that was rendering when deployed, but deploying to a clean environment yields in nothing being found at the source
, and only something at the destination
path. It works just fine locally, but only when deployed through this module is it not working. Could it be that rewrites aren't supported for static files here?
from terraform-aws-next-js.
I've been doing more debugging - this might be a separate issue really, but it seems rewrites work just fine to pages when deployed with this module, or with static files when developing locally, however static files deployed with a rewrite rule don't have any effect when deployed through this module.
from terraform-aws-next-js.
Sorry for the delay here 🙈
@benkraus Tested it today with this example and the rewrite is also applied to the static file (See https://d1nxi0kwcwado6.cloudfront.net/apple-app-site-association).
from terraform-aws-next-js.
@crabdul Yep the feature is still on the roadmap but not prioritized or planned at this time.
Need some time to create a proof of concept for this, because I am not sure if it would work the way I described it in the first comment.
I generally plan to create a new release each month (0.8.0
, 0.9.0
, etc.).
The scope for the upcoming 0.9.0
release in May is already frozen.
I can try to prioritize this for the 0.10.0
release which would be due in June.
from terraform-aws-next-js.
Absolutely bizarre, thanks for the sample project @ofhouse, I should have done that! Apparently something is just really messed up on my end, but I can see it certainly is working fine here... Appreciate everything!
from terraform-aws-next-js.
Related Issues (20)
- Modify proxy to force a version change HOT 1
- Unable to attach policy to lambda, since the iam.tf is missing in all versions starting from 1.0.0-canary.2 HOT 1
- Error: Authentication Failed Returns Status Code 0
- What services does this library use internally to manage deployments? HOT 1
- Unable to use redirect inside getServerSideProps HOT 3
- [Bug] Error while using middleware from Next 12.2 HOT 1
- TimeoutError: Promise timed out after 300000 milliseconds HOT 1
- Question: how can I use this module if I am using Cloudflare for DNS management and WAF? HOT 2
- Dynamic Routes like [id].tsx doesn't be update in my github action
- Q: What permissinos are needed for deployment? HOT 1
- Next.js v13 support HOT 10
- One or more of the CNAMEs you provided are already associated with a different resource. HOT 1
- Cannot deploy - .next-tf/lambdas\__NEXT_PAGE_LAMBDA_0.zip: no such file or directory HOT 1
- Is there a localstack sample available? HOT 1
- Getting Error during creating resources with terraform
- Deployment not deletes old files from s3 HOT 1
- NextAuth CLIENT_FETCH_ERROR , NEXTAUTH_URL
- New deployments not possible due as AWS ACLs are disabled by default HOT 1
- Alternatives? HOT 2
- Lambda functions no longer support NodeJS `v14` . HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-aws-next-js.