vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.23k stars 8.26k forks source link

Vue error in nuxt 3 project #12177

Open nurgeldiserikbay opened 2 hours ago

nurgeldiserikbay commented 2 hours ago

Vue version

^3.5.12

Link to minimal reproduction

https://iipmed.crocos.kz/

Steps to reproduce

Perhaps this is a bug in Nuxt 3 or UnoCSS for vue3, but in my project there is an error that does not allow Nuxt to work correctly. The error itself occurs on this line

image

What is expected?

const camelize = cacheStringFunction( (str) => { return str.replace(camelizeRE, (_, c) => c && c.toUpperCase ? c.toUpperCase() : ""); } );

I fixed this problem like this in a local project, because I get an error that toUpperCase is not a function. but it seems the following option would be correct

const camelize = cacheStringFunction( (str) => { return str.replace(camelizeRE, (_, c) => c ? str[c].toUpperCase() : ""); } );

What is actually happening?

const camelize = cacheStringFunction( (str) => { return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); } );

I don’t know what this function is for, but when outputting the value to the console, an error occurs when str = margin-top. variable c here will be a number and there is no string method on it. and it seems the function is not finalized

System Info

No response

Any additional comments?

No response

jh-leong commented 2 hours ago

Please follow the issue requirement and provide a reproduction so we can investigate