GithubHelp home page GithubHelp logo

Comments (5)

rushil-patel avatar rushil-patel commented on July 28, 2024 1

@kyle-mccarthy Yeah sure thing. Here is a demo repo. The master branch is working as expected with Next v11. I put a branch called next-12 where you can observe the broken behavior, following these steps:
repo: https://github.com/rushil-patel/nest-next-test

// SETUP Clone nest-next-test repository and check out the next-12 branch

  • yarn

  • yarn build

  • yarn start

  • Navigate to http://localhost:3000/1 // you'll see a 500 internal error

You'll see in the stacktrace that the id url parameter is not 1 but ends up being [id].

To see it work with next 11 checkout the master branch and run the exact 4 steps above

from nest-next.

rushil-patel avatar rushil-patel commented on July 28, 2024

For now the work around i've got to work is to wire it up manually:


  @Get('/:id')
  public post(@Res() res: Response, @Param('id') id: string) {
    return res.render(`${id}`, { id });
  }

It'd be nice if the injection happened automatically though

from nest-next.

kyle-mccarthy avatar kyle-mccarthy commented on July 28, 2024

Hey, thanks for reporting this. Would you be able to create a minimal reproducible example and provide a link to the example repository?

from nest-next.

rushil-patel avatar rushil-patel commented on July 28, 2024

Any idea on if this issue can be addressed within nest-next? I'd be willing to take a stab at it but am not entirely sure what the root cause is. Would appreciate any pointers.

from nest-next.

kyle-mccarthy avatar kyle-mccarthy commented on July 28, 2024

Hey, sorry, I just had the opportunity to look into this issue. I noticed that in your example, you used the monorepo approach; this was contributed by a member that has since deleted their GitHub account. Unfortunately, this was never a use case of mine, and I cannot provide any meaningful suggestions or workarounds.

That being said, the "basic" example still works as expected. The primary difference between the "basic" and "monorepo" example is that the monorepo attempts to bypass how Next treats the pages directory. Next is pretty opinionated in how they treat the pages directory, even when using the custom server approach.

It may be possible to get around the problem by symlinking the pages directory; however, this is obviously less than ideal. Given that the contributor can no longer provide support, I will start to remove the example and references to it in the documentation.

If you can get it working, I would appreciate it if you could let me know or make a PR with fixes for the documentation and examples.

from nest-next.

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.