Closed febriardis closed 1 year ago
What does yarn why unctx
or npm why unctx
say?
unctx
is from sentry module. But now, i use sentry version 7.1.3, it's no such issue in my project
If you are not gonna answer my questions then I won't be able to help you. Using older version is not really a solution to the issue.
@rchl this is bro
This is with latest module version?
I have same problem
I would expect there to be an error if 0.0.3 version of unctx
is used but this module only imports unctx
from the root of the module so I would expect it to resolve to the one within the @nuxtjs/sentry
package. Maybe Bridge changes something about where module's code is executed from... Any idea @danielroe ?
No, Nuxt Bridge shouldn't change how the module code is executed or its dependencies are imported; jiti
(used in pure Nuxt 2 as well) will be handling that, but it may well be an issue stemming from there (cc: @pi0).
I would recommend updating the critters module; the current version is much newer and depends on nuxt/kit v3.4.3.
Wouldn't upgrading to latest version of @nuxtjs/critters
create additional type issues due to inclusion of @nuxt/schema
? At least when running yarn tsc
without skipLibCheck
?
I've tried to reproduce it by installing @nuxtjs/critters@0.2.0
module and also by forcing unctx@0.0.3
to be hoisted but I couldn't reproduce.
Maybe the jiti
dependency or some related one is outdated in your project and triggers some already fixed bug? You could run npm upgrade
or yarn upgrade
to update all dependencies including the implicit ones and see if that fixes it. Or alternatively delete the lock file and node_modules
manually and re-install dependencies.
This issue coincidentally hit me now, when I've installed nuxt-timings
in my project. And I now see why it's happening.
It's because the old version of unctx
creates nuxt
context first and then when the new version of unctx
used by this project expects to find tryUse
in the context, it can't find it.
By design unctx
operates on global variable so having different versions of it in use at the same time causes issues.
Version
@nuxtjs/sentry: 7.1.13 nuxt: nuxt bridge
when npm run dev i get error like this: