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

Regression: Square brackets in filename #17

Closed
frandiox opened this issue Feb 28, 2021 · 4 comments
Closed

Regression: Square brackets in filename #17

frandiox opened this issue Feb 28, 2021 · 4 comments

Comments

@frandiox
Copy link

Hi! I'm having an error related to #16 using 0.4.7. I'm trying to deploy to Cloudflare Workers and it works in 0.4.6 (it seems CF workers allow brackets in the filenames), so I guess this is a regression issue.

I have a route /hi/:name (like in Vitesse) and the build outputs a file dist/client/assets/_name_.0441a72a.js for that one. There's no file with brackets. However, another JS file is trying to import the following:

component:()=>Mt((()=>__import__("./[name].0441a72a.js")),["/assets/_name_.0441a72a.js","/assets/vendor.2de24244.js"])

It is trying to request both, brackets and underscored versions:

image

I'll downgrade to 0.4.6 for now, which outputs the file with brackets only.

Thanks!

@hannoeru
Copy link
Owner

Can you provide a repro?

@tshemeng
Copy link

tshemeng commented Mar 2, 2021

@frandiox since 0.4.6, you need add replaceSquareBrackets: false to vite-plugin-pages config,

example:

    // https://github.com/hannoeru/vite-plugin-pages
    Pages({
      extensions: ['vue', 'md'],
      replaceSquareBrackets: false
    }),

@frandiox
Copy link
Author

frandiox commented Mar 2, 2021

@tshemeng Ah I see, thanks!
In any case, I'll try to add a repro for the default case since I guess it shouldn't be requesting both...

@hannoeru
Copy link
Owner

hannoeru commented Mar 2, 2021

I think replace square brackets break dynamic routes so I will revert it now until I find a solution, you can upgrade to v0.4.8 and remove replaceSquareBrackets from options.

@hannoeru hannoeru closed this as completed Mar 2, 2021
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