question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use Intl object input with Sanity Studio >= ^2.9.0 even with beta.1

See original GitHub issue

I tried to make the Intl input plugin work with Sanity >=2.9.0 but I get this error instead:

Error in ./node_modules/sanity-plugin-intl-input/lib/resolver (part:@sanity/form-builder/input-resolver)
Module not found: Error: Can't resolve '@sanity/form-builder/lib/utils/isEmpty' in '/Users/flayks/sites/site/sanity/node_modules/sanity-plugin-intl-input/lib/resolver'
 @ ./node_modules/sanity-plugin-intl-input/lib/resolver (part:@sanity/form-builder/input-resolver 14:14-63)

Example of a field:

// ./schemas/wine/wine.js
...
{
    name: 'conditions',
    title: 'Vintage conditions',
    type: 'text',
    options: {
        i18n: true,
        base: baseLanguage,
        languages,
    },
},

// ./schemas/languages.js
export const languages = [
    { name: 'en', title: 'English', default: true },
    { name: 'fr', title: 'Français' },
]

export const baseLanguage = languages.find(lang => lang.default)

As with the latest stable version (5.0.6), when using with the default example from Sanity with the version 2.9.0 or 2.10.0, I simply can’t see the Intl object input for instance. No error here, but nothing is displayed in the document 🤷 I have to downgrade to Sanity 2.6.0 to see it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gpoolecommented, Sep 22, 2021

Also finding this with sanity-plugin-intl-input@5.2.1 and sanity@2.19.0. The following works:

{
  name: 'label',
  title: 'Label',
  type: 'object',
  options: {
    i18n: true
  },
  fields: [
    {
      name: 'example',
      title: 'Example',
      type: 'string'
    }
  ]
}

This doesn’t:

{
  name: 'label',
  title: 'Label',
  type: 'string',
  options: {
    i18n: true
  }
}

No error, it just doesn’t do anything. The documentation doesn’t say whether it’s possible to apply to fields like string, is this supported?

0reactions
victory-sokolovcommented, May 27, 2021

I don’t have any errors, but when I’m using Intl object for a specific input, languages for translation are not displayed. Wide translation works fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while configuring sanity-plugin-intl-input
Add the configuration file in your studio's config folder. It should be called intl-input.json and needs to be an empty object
Read more >
Code input and schema for Sanity Studio - GitHub
What is it? Code input for Sanity. Currently only a subset of languages and features are exposed, over time we will implement a...
Read more >
@sanity/document-internationalization - npm
This plugin adds features to the Studio to improve handling document-level translations. A View Pane to create language versions of each ...
Read more >
Bug listing with status RESOLVED with resolution UPSTREAM ...
... Bug:44348 - "Update Ming to 0.3beta1" status:RESOLVED resolution:UPSTREAM ... new projects using kdevelop fails config due to gentoo sanity check (bug ...
Read more >
Node.js ChangeLog - Google Git
Node.js ChangeLog. 2016-01-12, Version 5.4.1 (Stable), @TheAlphaNerd. Notable Changes. Minor performance improvements: module: move unnecessary work for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found