Coder Social home page Coder Social logo

Comments (10)

ofhouse avatar ofhouse commented on July 19, 2024 3

Good news, we finally have a new v0.2.0 release out that should fix the issue.

Please note that you also need to update the @dealmore/terraform-next-build in your package.json to 0.2.0.

from terraform-aws-next-js.

andrewgadziksonos avatar andrewgadziksonos commented on July 19, 2024

I realized that I forgot to add a next.config.js file to the repo, after adding the following,

module.exports = {
  // Build the server for a serverless environment
  target: 'serverless',
};

and rebuilding, I'm still seeing the same errors

from terraform-aws-next-js.

ofhouse avatar ofhouse commented on July 19, 2024

Thanks for creating & posting that example.
Will take a deeper look tomorrow. Could be possible that something broke with the latest Next.js 10 release, we haven't upgraded yet.

from terraform-aws-next-js.

andrewgadziksonos avatar andrewgadziksonos commented on July 19, 2024

I’ll also try and downgrade to 9.5 later and see if that fixes it. Thanks!

from terraform-aws-next-js.

andrewgadziksonos avatar andrewgadziksonos commented on July 19, 2024

Hmm - That didn't seem to help. Using [email protected] still produces 404s - no errors in the logs. Let me know if you need anything else from me.

from terraform-aws-next-js.

ofhouse avatar ofhouse commented on July 19, 2024

Sorry for the delay. Checked it out and got the same result, so routing is definitely broken for this example.
Currently gearing up a better testing solution for real world examples which I expect to ship by tomorrow and then I can take a better look what happened in this case.

from terraform-aws-next-js.

andrewgadziksonos avatar andrewgadziksonos commented on July 19, 2024

No worries, and sounds good. I'm happy to help debug if needed

from terraform-aws-next-js.

ofhouse avatar ofhouse commented on July 19, 2024

Short update regarding this issue:
I've tracked the issue down to this code:
https://github.com/dealmore/terraform-aws-next-js/blob/main/packages/proxy/src/proxy.ts#L92

This was a workaround introduced for slug routes (e.g. /some-page/[...slug]) that we mostly rely on for our own projects.
While it works for slug-routes it breaks dynamic routing (e.g. /some-page/[id]) at this point because it cuts the arguments from the URL and prevents the dynamic part from being passed to the lambda.

To prevent the issue in the future we set up an local e2e testing (proxy -> lambda) in #17 powered by AWS SAM and introduce further unit tests to cover that use cases.

Routing is a bit complicated here because it is mostly based on reverse engineering Vercel's proxy solution but with the testing we should have a solution ready soon.

from terraform-aws-next-js.

andrewgadziksonos avatar andrewgadziksonos commented on July 19, 2024

Thanks @ofhouse for the update! Looking forward to the fix. Let me know how I can help

from terraform-aws-next-js.

ofhouse avatar ofhouse commented on July 19, 2024

@andrewgadziksonos ok, end of the year was busier than I thought, so sorry again for the delay on this issue 🙈.

I finally implemented a working solution for the issue and the e2e tests results also confirm that it is working.
I track the current status in #17 and when CI is green we are ready for a new release 😬

Unfortunately there is still one test failing for a fallback route.
Since fallback routes didn't work before either I think this is not necessarily linked to this issue and we may defer support for fallback routes in a feature request.
Will make decision on this tomorrow and then I will publish a new release.

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.