-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency not found klona/full #1004
Comments
Already tried it. |
Hello, Well, if version 6.16.0 was installed then klona would be here, however, it's not found. Basically could you please run yarn install or npm install? Clearing .nuxt cache might help also. Thanks! |
Check this: https://unpkg.com/browse/klona@2.0.4/ There is something wrong with your system/setup. Possibly with the yarn/npm cache. |
I've just spinned up new nuxt app and I can't recreate the problem that you're having. |
I think that I have a clue. Inside Since the file importing klona is Would that be possible? |
I have just reproduced it locally. I've installed I've moved klona to peerDependencies as It's just throwing warning but not installing newer version: warning " > nuxt-i18n@6.16.0" has unmet peer dependency "klona@^2.0.4". @rchl what do you think? Should we move to peerDependencies or just keep it as it is. Basically, it doesn't resolve the issue, @Alphability you need to upgrade your local Thanks! |
Since some of nuxt-i18n code runs outside of the package itself I recommend you to install the dependencies needed on the outside as peerDependencies. Those dependencies are not auto-installed. Your setup section should just look like this:
|
It does feel like it would make sense for modules to specify dependencies that they use in plugins as peer dependencies. It's not a normal practice though, as far as I can tell, and it would be kinda unusual to do that. Not to mention that requiring the user to manage dependencies himself would make things a lot less user-friendly and potentially error-prone. For example, a module can enforce certain dependency versions while it's not as straight-forward with peer dependencies. It can still specify which version should be used but if the user doesn't match that, it will only result in an easy-to-miss warning when installing dependencies. As for this particular problem, you can of course just install |
I totally understand your point. From my perspective the real less user friendly thing and error prone to do is to let open the possibility to get an error like this with complex projects. The more dependencies you have and/or need the more likely you are to get this error... and the more likely to waste a lot of time trying to understand where it comes from. Yes peerDependencies are scary... but they're here for a reason.
In my opinion, It is never a bad idea to make people accountable (especially developers) for what they do. @atinux @pi0 what is your opinion about this pretty interesting matter? |
|
Yeah that is a problem... but this problem comes directly from the fact that we can add plugins with a module. Thanks for the chat @rchl, this is really interesting! 🙏 I am eager to read from Atinux and pi0 on this! |
Hi @rchl. You can resolve full path of klona on behalf of module for exact version that requires: nuxt.options.alias['klona'] = require.resolve('klona/lite')
// Alt: nuxt.options.alias['~i18n-klona'] = require.resolve('klona/lite') For a longer answer, I'm compiling runtime instead of emitting as plugin template for image and auth modules and adding this pattern with new module template and nuxt/kit. This resolves implicit dependency issues as well as making runtime lintable/typed. |
I found this issue when doing an upgrade on dependencies for my project. I could install
Just from a naive, dumb user point of view, should this not be resolved on the i18n module side of things? |
@ABleas Just because a 404 is not as lethal as a bridge collapsing doesn't mean that you're free to stop learning how to do your job 😘 |
Sorry for sounding gruff. I appreciate that it's important to somebody, but it isn't my job to understand everything that goes on under the hood of this wonderful module. That would make my job impossible! I should also say, I am really happy with nuxt-i18n. It is a pleasure to use. |
Hello, it seems that this issue still be here. We've update to the last release and have this error :
|
Of course npm install --save ~i18n-klona doesn't work |
Delete node_modules and try again:
|
It's working, thank you :) |
Version
nuxt-i18n: 6.16.0
nuxt: 2.14.12
Nuxt configuration
mode:
Steps to reproduce
Upgrade or install nuxt-i18n.
What is Expected?
The lib is expected to work.
What is actually happening?
It doesn't... (See the issue's title)
The text was updated successfully, but these errors were encountered: