question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect pages generated with layout plugin

See original GitHub issue

With vite-plugin-vue-layouts Screenshot 2021-05-13 at 9 09 53 PM

Without vite-plugin-vue-layouts Screenshot 2021-05-13 at 9 09 58 PM

Vite-SSG plugin example Screenshot 2021-05-13 at 9 18 47 PM

With the layout plugin, extra folders are created and the content is same as index.html

Screenshot 2021-05-13 at 9 25 18 PM

When i visit /readme, i get the content from readme folder instead of correct readme.html

Please let me know if this the expected behaviour or a bug.

I am big fan of your open source work 😃 Thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hannoerucommented, May 18, 2021

Just fixed empty string problem with vite-ssg, can you try it?

1reaction
ctholhocommented, May 18, 2021

Thanks for looking into this @hannoeru.

I had expected a nested router view that has a path starting with '/' would just be displayed at root level; without anything weird happening to the routes object. As per the vue router docs#nested routes:

Note that nested paths that start with / will be treated as a root path. This allows you to leverage the component nesting without having to use a nested URL.

So my assumption was, if a root level route had the same path as a children route (with a prefixed /), it should be displayed at the same path, and therefore also be rendered at the same path.

Replacing the path of children to an empty string '' (also proposed in the router docs) is possible but always creates a dist/.html file that’s identical with dist/index.html (if building with vite-ssg)

Could the culprit be this? vite-SSG /utils.ts#L25

That being said: Are there any issues for website visitors that result in missing, wrongly displayed pages? (I’m asking to know if this issue should be high priority for vite-plugin-vue-layouts)

Regarding route.name: Linking to a named page should still work because vue-router looks for names in children.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Layout Issues - Elementor
To find a plugin that is causing the layout issue, deactivate all of your plugins except Elementor and Elementor Pro, if applicable. If...
Read more >
How to edit page not template - WordPress.org
Problem is that I was able to customize the template via the Gutenverse plugin, but when I go to Pages, each page that...
Read more >
Advanced Layout Editor hangs; loading wheel keeps spinning ...
Hello, We are experiencing some issues with our site (URL in private section). On certain pages, when entering edit mode, everything will ...
Read more >
WordPress Changes Not Showing? 3 Methods to Fix It Right ...
When WordPress is not showing changes right away, it is most likely still displaying a cached version. Learn three ways to fix this...
Read more >
hannoeru/vite-plugin-pages: File system based route ... - GitHub
By default a page is a Vue component exported from a .vue or .js file in the src/pages directory. You can access the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found