Closed AjaniBilby closed 1 year ago
This is too strange, i'm already filtering the dynamic routes without a SitemapFunction
here
I also tried to add the admin.transaction.$tr..
routes, in a new project and it works as expected.
Maybe your route manifest is different for a specific adapter or something, can you provide a repo with the error?
Thanks!
If you clone this and run npx remix-sitemap
in the root directory you will get the behaviour I was referring to.
It generates these <loc>
s which don't exist:
https://beta.signplanet.net/bulk-import
https://beta.signplanet.net/delete
https://beta.signplanet.net/signs
🔍 Found routes: root, routes/dictionary_.$dictID_.edit.bulk-import, routes/dictionary_.$dictID_.edit.delete, routes/dictionary_.$dictID_.edit.signs, routes/dictionary_.$dictID._index, routes/dictionary_.$dictID.signs, routes/dictionary_.$dictID_.edit, routes/dictionary_.$dictID, routes/healthcheck, routes/dictionary, routes/eula
✨ Sitemap generated successfully
Now i found the issue, it seems that the internal path in the manifest is nested if any parent route exist.
With that repo if i remove dictionary_.$dictID.tsx
the children route signs
works as expected but with it i don't get the complete path (/dictionary/:dictID/signs
) i just get signs
and it doesn't match the condition, same goes for dictionary_.$dictID.edit.tsx
.
I'm going to try moving the validation to check the internal path id, it seems to always be the same.
Hi @AjaniBilby this should be fixed in the latest version (2.2.4), can you try again? thanks
npx remix-sitemap
🔍 Found config file: C:\Users\me\Documents\GitHub\signplanet\remix-sitemap.config.js
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:405:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:133:11)
at defaultLoad (node:internal/modules/esm/load:84:3)
at DefaultModuleLoader.load (node:internal/modules/esm/loader:281:26)
at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:192:22)
at new ModuleJob (node:internal/modules/esm/module_job:63:26)
at #createModuleJob (node:internal/modules/esm/loader:216:17)
at DefaultModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:169:34)
at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:154:17)
at DefaultModuleLoader.import (node:internal/modules/esm/loader:245:28) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Node.js v20.3.1
Sorry, are you using the version 2.2.4? the remix-sitemap command should be common js not esm
Theoretically it is using that version, but you don't seem to have a --version
command, and npx
can behave in weird ways sometimes
cat node_modules\remix-sitemap\package.json
{
"name": "remix-sitemap",
"version": "2.2.4",
Ok, i can't debug this propertly because looks like a specific windows error but i guess is an error with the import of the config file
i merged this https://github.com/fedeya/remix-sitemap/pull/48 to try to fix it and i released a new version (2.2.5) can you try again with it? sorry
2.2.5
works, except for some reason there are some routes like /login/undefined
in the sitemap which I haven't got time to attempt to replicate right now
Oh yeah i forgot to handle the index nested route case, i guess i fixed it in a new release (2.2.6), could you try again?
This now works completely including successful dynamic route generation, and also exclusions are correctly applying.
Thank you 🫡
Describe the bug When I run
remix-sitemap
it does correctly identify all of the routes:However it generates a lot of bogus data where it's clearly missing the url before the slug.
i.e.
It just so happens these two examples are ones I should mask out of the sitemap, however there are also many others, it appears to just lose all information about the URL before any slug, and only uses the trailing most portion.
Also in this project I haven't setup any
SitemapFunction
s yet, as I was just trying to get static urls sitemapped first to ensure I even want to use this library.Ideally any url with a slug which doesn't have a
SitemapFunction
binding should be ommited from the sitemap.remix-sitemap.config.js
Environment:
Microsoft Windows [Version 10.0.22621.2134]
"remix-sitemap": "^2.2.1"
, using remix1.19.3