I18n-module: Dependency not found klona/full

Created on 21 Dec 2020  路  9Comments  路  Source: nuxt-community/i18n-module

Version

nuxt-i18n: 6.16.0
nuxt: 2.14.12

Nuxt configuration

mode:

  • [X] universal
  • [ ] spa

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)

This dependency was not found:                                                                
* klona/full in ./.nuxt/nuxt-i18n/plugin.main.js
To install it, you can run: npm install --save klona/full
bug 馃悰

All 9 comments

994

Already tried it.
Did not work.
It has nothing to do with caching.

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!

  • [X] yarn remove nuxt-i18n
  • [X] yarn add -S nuxt-i18n
  • [X] Removed ./node_modules
  • [X] Removed ./cache
  • [X] Removed ./.nuxt
  • [X] yarn install

Still not working.
klona is present in ./node_modules... but without the _"full"_ directory within it.

Here's klona package.json's exports section.
Capture d鈥櫭ヽran 2020-12-22 脿 00 17 54

They reference the export of the _"full"_ directory which contains a js file needed to run nuxt-i18n (since you import that js file in ./.nuxt/nuxt-i18n/plugin.main.js).

The files klona/full/index.mjs and klona/full/index.js are not there in the v6.16.0 of nuxt-i18n, thus it doesn't work.

Check this: https://unpkg.com/browse/[email protected]/

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 ./node_modules/nuxt-i18n there is [email protected].
There is [email protected] at ./node_modules/klona.

Since the file importing klona is ./.nuxt/nuxt-i18n/plugin.main.js, I think that it searches for _"full"_ inside ./node_modules/[email protected] and not ./node_modules/nuxt-i18n/[email protected].

Would that be possible?
Wouldn't peerDependencies solve the whole thing?

I think that I have a clue.

Inside ./node_modules/nuxt-i18n there is [email protected].
There is [email protected] at ./node_modules/klona.

Since the file importing klona is ./.nuxt/nuxt-i18n/plugin.main.js, I think that it searches for _"full"_ inside ./node_modules/[email protected] and not ./node_modules/nuxt-i18n/[email protected].

Would that be possible?
Wouldn't peerDependencies solve the whole thing?

I have just reproduced it locally. I've installed [email protected] and after added nuxt-i18n. It throws errors on compile because klona is an older version which doesn't contain full directory https://github.com/lukeed/klona/releases/tag/v2.0.0

I've moved klona to peerDependencies as It's just throwing warning but not installing newer version:

warning " > [email protected]" 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 klona version to ^2.

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.
That's what they're for if you read yarn or npm documentation.

Those dependencies are not auto-installed.
So, you'll need to tell your users to install them.

Your setup section should just look like this:

# yarn
yarn add nuxt-i18n klona@2

# npm
npm i nuxt-i18n klona@2
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonalxh picture jonalxh  路  15Comments

simplenotezy picture simplenotezy  路  28Comments

albanm picture albanm  路  20Comments

javialon26 picture javialon26  路  20Comments

varna picture varna  路  14Comments