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

Escape or replace square brackets in file names? #16

Closed
thalesagapito opened this issue Feb 27, 2021 · 4 comments
Closed

Escape or replace square brackets in file names? #16

thalesagapito opened this issue Feb 27, 2021 · 4 comments

Comments

@thalesagapito
Copy link

Like with the nuxt routing module, the generation of routes with square brackets makes the plugin unusable in aws API Gateway environments. Original issue for reference: nuxt/nuxt#7625.

The problem is that API Gateway does not consider urls with square brackets valid, which makes dynamic and catch-all route files throw errors when loaded. Is there any way to replace these on build?
For now, I believe a workaround is to remove the brackets manually inside the dist folder, but ideally the plugin could have a way ty prevent this problem.

@frandiox
Copy link

@thalesagapito Hey, did you find this error when using vite-ssr or Nuxt?

@thalesagapito
Copy link
Author

I was using vite-ssr, I just mentioned the nuxt issue because the nuxt team has faced the same problem before. Sorry if I wasn't clear.

hannoeru added a commit that referenced this issue Mar 2, 2021
@hannoeru hannoeru reopened this Mar 2, 2021
@hannoeru
Copy link
Owner

hannoeru commented Mar 2, 2021

@thalesagapito from v0.4.9 I set replaceSquareBrackets to false by default because it will break dynamic pages, you can manually set it to true it you want.

@hannoeru
Copy link
Owner

hannoeru commented Mar 2, 2021

From v0.5.0 replace square brackets should also works in dynamic pages with replaceSquareBrackets option set to true.

@hannoeru hannoeru closed this as completed Mar 2, 2021
ckangwen pushed a commit to charrue/vite-plugin-pages that referenced this issue Jan 24, 2023
ckangwen pushed a commit to charrue/vite-plugin-pages that referenced this issue Jan 24, 2023
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