Comments (5)
@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.
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.
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.
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.
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)
- got a lot of 404 error HOT 1
- Next "catch all routes" does not work HOT 1
- When using generate staticPaths, staticProps and then use it to get page - it always says 404. Only works for fallback: 'blocking' HOT 5
- Make an npx starter
- next.server.dynamicRoutes.map is a TypeError HOT 7
- Help with Setup HOT 2
- Cannot read properties of undefined (reading 'nextConfig') HOT 4
- Failed to serve static file from next side
- Cannot render page with path "\index", did you mean "/\index"? HOT 5
- How to shallow render with next useRouter hooks? HOT 1
- Next.js 12 hmr HOT 3
- How to set next.config and how to use less HOT 1
- Not able to reach nest endpoints. HOT 1
- Module-wide type error (Fix included) HOT 3
- Usage with Next@13 HOT 8
- Nest routing issue with nested pages HOT 15
- nest-next test suite HOT 1
- Standalone Nest application HOT 1
- res.setHeader is not a function When i add new FastifyAdapter() HOT 10
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 nest-next.