Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hybrid route character configurable #57

Open
ZipBrandon opened this issue Jun 6, 2023 · 3 comments
Open

Make hybrid route character configurable #57

ZipBrandon opened this issue Jun 6, 2023 · 3 comments

Comments

@ZipBrandon
Copy link

Thanks for creating this. I love this approach to v2 routing. I converted my application over to embrace it and unfortunately when I deployed on S3 my route files were 404/AccessDenied. I delved into this further and even though I can create a path in the bucket with the +, S3 requires those assets to be requested with the + URL encoded to %3D. I asked in Remix Discord if there was a way to rewrite asset imports but there isn't. I had to resolve my problem using a terminal - convention instead of the terminal + and hard-coded - into my clone of the repo. If this issue is of wider appeal and I'm not missing anything obvious, I can work a proper PR for configurability of this.

@kiliman
Copy link
Owner

kiliman commented Jun 6, 2023

Interesting. So it's trying to access the build assets? Seems like something Remix or esbuild should handle then.

Anyway you're asking if I can add an option to configure the + suffix? That should be easy. I already do that for the $ prefix.

@ld-kyee
Copy link

ld-kyee commented Nov 3, 2023

Hi, I'm also having this issue, are there any updates for this pr? #70

@kiliman
Copy link
Owner

kiliman commented Jun 21, 2024

Here's a temporary workaround:

{
  routes: async defineRoutes => {
    const routes = flatRoutes('routes', defineRoutes)
    // remove + in route ids
    const newRoutes = {}
    Object.entries(routes).forEach(([routeId, route]) => {
      route.id = routeId.replaceAll('+', '')
      if (route.parentId) {
        route.parentId = route.parentId.replaceAll('+', '')
      }
      newRoutes[route.id] = route
    })
    return newRoutes
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants