Open thornomad opened 6 months ago
This doesn't look like generated by the latest version of this module. Should have import merge from '~lodash.mergewith'
instead. Make sure the dependencies are properly updated.
Hi @rchl — thanks for your response. All right ... let me look into this a bit further. Based on on yarn.lock
file it appears upgraded to me but let me go through this one more time and see if something is off with our package management.
I thought maybe there was something to do with our build
process that was throwing it off that I didn't understand. I will report back with my progress.
delete nuxt_modules
, delete .nuxt
, reinstall dependencies, start nuxt and check again
if nuxt fails to start correctly that it would not re-generate those sentry files so you would be seeing old versions
I started over with:
rm -rf node_modules .nuxt dist
yarn cache clean
yarn install
However, same problem. I then looked inside of .nuxt/sentry.client.shared.js
and I can see that the line you are expecting exists there as you indicated:
import merge from '~lodash.mergewith'
So, it's in the built source; however, when I follow the error from the browser console to view the source of the file in my browser it has been converted (along with other lines actually) to the broken version.
With this knoweldge, I went ahead and disabled the nuxt-vite
module inside of buildModules
in nuxt.config.js
and the problem went away. I then re-enabled it and the problem came back. So, it seems that the problem is related to the nuxt-vite
module.
That's helped me to narrow it down. Now just need to figure out what nuxt-vite is doing wrong here.
I am working to upgrade the
nuxt/sentry
module to8.x
from6.x
. I am using nuxt2.17.3
. The upgrade went smoothly until I loaded my browser and I get an error in the console:This problem stems from
.nuxt/sentry.client.shared.js
which appears (to me) to be auto-generated during the build. (I'm new to Nuxt so sorry if this is obvious!). In the console, I can inspect that file and see the import statement that is causing the error:When I look at
node_modules/lodash.mergewith/index.js
I see it is usingmodule.exports
instead ofexport default
so it seems this would mean we would need torequire('lodash.mergewith')
.My question is: Why doesn't nuxt know to do that already? How do I tell it to? I've been googling and chat-gpt-ing and not finding any straightforward answer to what I am missing here.
Appreciate anyone who can point me in the right direction to sort this out. I've inherited this project on the front-end and still figuring out this ecosystem. Thanks!
configs
My simplified
nuxt.config.js
file looks like: