Giter Site home page Giter Site logo

Comments (3)

manniL avatar manniL commented on July 24, 2024 1

Can you provide a reproduction where/when route names collide? Does that also happen without typedPages?

Unfortunately, functions are not allowed at all in the nuxt.config.ts to make sure the config is serializable but probably another way (like router.options.ts) would be an option for configuration

from nuxt.js.

github-actions avatar github-actions commented on July 24, 2024

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

from nuxt.js.

danielwaltz avatar danielwaltz commented on July 24, 2024

@manniL Absolutely! Here's a minimal as I could make it reproduction of the issue.

https://stackblitz.com/edit/nuxt-starter-1zwqrx?file=nuxt.config.ts

For context, I created logical route groups for /account/admin and /account/user, where the goal is to not have the paths /admin and /user appear in the url, instead having their child pages show directly under /account. You can see this working without any changes in the example.

To reproduce the issue with typedPages, enable the option and open the utils/directory.ts file and swap the commented blocks of code. You should see type errors in the directory map, and if you inspect the keys on the RouteNamedMap type from vue-router/auto/routes you'll see that some pages are missing (presumably because they are using the same path).

This is why I think it would be useful to provide custom logic to generate the name, so I can use more info than just the path to define what is a unique route.

I get this is kind of a unique case born from a desire for logical grouping of routes, but I do still think it could be useful to provide custom config for other use cases (and this could help support creating a nuxt module that enables support for logical page groups which I have WIP code for).

from nuxt.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.