Coder Social home page Coder Social logo

Comments (9)

ofhouse avatar ofhouse commented on July 20, 2024 2

@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:

  1. Rename the file public/apple-app-site-association -> public/apple-app-site-association.json (Content type should then be set correctly by mime package)
  2. 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.

benkraus avatar benkraus commented on July 20, 2024 1

Nice, that worked great, thanks!

from terraform-aws-next-js.

benkraus avatar benkraus commented on July 20, 2024

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.

crabdul avatar crabdul commented on July 20, 2024

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.

benkraus avatar benkraus commented on July 20, 2024

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.

benkraus avatar benkraus commented on July 20, 2024

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.

ofhouse avatar ofhouse commented on July 20, 2024

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.

ofhouse avatar ofhouse commented on July 20, 2024

@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.

benkraus avatar benkraus commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.