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.

An internal error occurred using includedRoutes option

See original GitHub issue

I am using the Vitesse template and when I try to use the includedRoutes option in a very basic way, I am getting an Internal error:

ssgOptions: {
    script: 'async',
    formatting: 'minify',
    onFinished() { generateSitemap() },
    includedRoutes(paths, routes) {
      console.log('paths is >  ', paths)
      return paths; 
      // exclude all the route paths that contains 'foo'
      // return paths.filter(i => !i.includes('foo'))
    },
  },

The paths are:

[vite-ssg] Build for server...
vite v2.8.6 building SSR bundle for production...
✓ 24 modules transformed.
.vite-ssg-temp/manifest.webmanifest        0.38 KiB
.vite-ssg-temp/main.mjs                    23.17 KiB
.vite-ssg-temp/assets/style.83469b32.css   13.87 KiB
paths is >   [ '/about', '/food', '/', '/:all(.*)*', '/hi/:name' ]

[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
(node:43200) UnhandledPromiseRejectionWarning: Error: [vite-ssg] Error on page: /:all(.*)*
Error: ENOENT: no such file or directory, open '...\TestGround\vitesse-1\dist\:all(.*)*.html'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
userquincommented, Mar 18, 2022

Do you mean that in that example i should also be filtering out any file name with “:” as well as “foo” ?

You shoud rename the logical names (route names) using :, just replace them with _: on generation, the logic name will be used to generate the html files, and so the error, using nuxt style you will be able to generate the html files via vite-ssg:

   includedRoutes(routes) {
      return routes.filter(r => !r.includes('*')).map((r) => {
        console.log(r)
        return r.replace(/:/g, '_')
      })
    },
0reactions
rezelutecommented, Mar 18, 2022

I think that makes sense, thank you, i will give this a try 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote desktop connection: An internal error has occurred
I have problem with RDP when connect to my Server (Windows 2016 std OS) ... Click on Show Options to unveil all the...
Read more >
[gatsby-source-wordpress] Error in includedRoutes ... - GitHub
Hi, I try to use includedRoutes option of gatsby-source-wordpress plugin but could not make it ... Is this an error in the documentation...
Read more >
How to Fix RDP Error : An Internal Error has Occurred.
Solution 1: Verify Remote Desktop Connection Settings · 1. Go to Start >> Run. Type the mstsc command and hit enter button ·...
Read more >
Error with Gatsby plugin Gatsby-Source-Wordpress
The options of gatsby-source-wordpress require... the base URL of the Wordpress site without the trailing slash and the protocol.
Read more >
Fixing the "Remote Desktop Connection: An Internal Error Has ...
And, for our final troubleshooting step, another less prevalent but possible issue is a setting on the Experience tab in the Remote Desktop...
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