Nuxt 3 Sitemap with @nuxtjs/sitemap
Hello there. I am a junior frontend dev aswell as a newbie in SEO (but improving !)
Sitemaps are for SEO needs a must have, and so i wanted to use the nuxt module to add one.
* i added nuxtjs/sitemap with this command
yarn add -D @nuxtjs/sitemap
* screeshot 1 (left) is a bunch of warnings after installing nuxtjs/sitemap. No error here
* According to the documentation, i have to add '@nuxtjs/sitemap'
to the modules in nuxt.config
. Done
* screeshot 2 is the error i get after launching the server with yarn. CTRL+SHIFT+F doesn't find any toValue.
I'm stuck here. Anyone can help me ?42 Replies
update your nuxt + vue version 🙂
seem like these are really old 😄
Woops 😄
Won't that break other depencies among all the packages installed ?
why should it break things/other deps?
I mean, you only should upgrade to new minor or patch versions, not from e.g. 1.x to 4.x 😄
Btw how can you tell i'm using an older vue version ?
Vue.js
Vue.js - The Progressive JavaScript Framework
and that's the error you get
Wow, thanks.
However npm show vue version display 3.4.26 which is latest version iirc
Do you know where can i change the used vue version in the project ?
how did you check it?
with this command :
npm show vue version
weird. maybe some subdependency doesn't use an updated vue version then
here is all occurences of 'vue' in my package.json
try
npx npm-why vue
because in the package.json, you don't have subdependencies listed
I Guess i'm using vue 3.2.47 x)
Interesting 🤔
Yeah, indeed 😄
still strange because the error hints something different 🙈
That is very weird lol
do you have any node_modules in folders "above" your project folder
I'll check
so imagine the path being /a/b/vmc-front-v3/, do you have some in /a/b or /a
oh wait
no no
3.2.47 is old
so you use an old version indeed
toValue is available in 3.3
what you can do: remove your package-lock.json and run
npm i
. This will install the dependencies with their "newest versions" based on the constraints
or you can try to only update vue npm update vue
No node_mules above fortunately.
I'll try that
OOF
restauring packages-lock.json and running
npm update vue
leads to the same issueyeah, you need a newer eslint-plugin-prettier version I suppose
ah no
bump prettier 😄
This feels like a rabbit hole 😄
(deps are a mess sometimes)
yeah, well
can you show your whole package json?
isn't it the beginning of me being fired for sharing potentially secret information ? haha
(i changed nuxt version from ^3.2.0 to ^3.11.0 in the packages.json)
there shouldn't be any secret info in the package json 😛
Lovely
ah yeah, bump prettier to the latest major (3.x) and then you should be able to resolve that issue
i think i already once have taken that road be ready for some snorkeling lol
and it continues 😄
https://www.npmjs.com/package/eslint-plugin-vue-libs seems not to be maintained anymore
npm
eslint-plugin-vue-libs
eslint plugin for vue.js projects. Latest version: 4.0.0, last published: 5 years ago. Start using eslint-plugin-vue-libs in your project by running
npm i eslint-plugin-vue-libs
. There are 13 other projects in the npm registry using eslint-plugin-vue-libs.❗ Note this is an internal plugin/config for the development of Vue itself, not intended for Vue app development.I mean, you can remove that IMO 😄
Oh, indeed
Should i force the uninstall ?
actually the easiest would be changing things in your package.json and then removing the lockfile and using
npm i
If you want to you could even pin the versions before to what they are now so you don't update anything else "accidentally"
but that's up to youI agree with you
However, how can i know what version for which package i want ?
Ok i have updated all the dependencies i needed (aswell as removing some deprecated ones)
now when i launch the app, i arrive on a blank page without any vue components, no error on the console, and no error on the app.vue
From here, go with basic debugging
* if you remove everything from the
app.vue
and render a TEST
h1, does it work?
* If not, remove plugins/modules
* etc etc
but here it looks like it doesn't render anything which is super weird
server console might have some errorsHow can i check this server console ?
If thats "main" in "output" section of terminal, no errors. Tried with some paragraphs. Nothing renders 😦 Even if i do npm i I sometimes have twelve of these ERROR Pre-transform error: Missing "./dist/app/compat/capi" specifier in "nuxt" package (x12), maybe that's the culprit
If thats "main" in "output" section of terminal, no errors. Tried with some paragraphs. Nothing renders 😦 Even if i do npm i I sometimes have twelve of these ERROR Pre-transform error: Missing "./dist/app/compat/capi" specifier in "nuxt" package (x12), maybe that's the culprit
that seems like 😄
Well, i've no clue on why i have these. there is no hint. If that's something you know, i'll be glad to hear 😄
I have investigated by starting a new branch with older dependancies and trying to update one by one seeing if the application launches.
With nuxt 3.6.5, all good,
With nuxt 3.7.0 and so forth,
ERROR Missing "./dist/app/compat/capi" specifier in "nuxt" package (x12)
and white screen at app launch