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.

Respond to Rollup warning for i18n.mjs

See original GitHub issue

What

This notice, which we think is coming from Rollup, currently appears in the test output:

Entry module “src/govuk/i18n.mjs” is implicitly using “default” export mode, which means for CommonJS output that its default export is assigned to “module.exports”. For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set “output.exports” to either “auto” or “default”, otherwise you might want to consider changing the signature of “src/govuk/i18n.mjs” to use named exports only.

Understand whether there are implications for consumers of GOV.UK Frontend and whether we need to make any changes.

If we don’t need to make any changes, see if there’s a way to silence the warning.

Why

src/govuk/i18n.mjs is a new file which has not yet been included in a release of GOV.UK Frontend.

We want to make sure that the way that we’ve written i18n.mjs will not impact consumers of GOV.UK Frontend once the next release has gone out.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • We understand the implications of the warning
  • We’ve made any changes required before shipping the next release
  • The warning no longer appears in the test output (unless it’s not possible to silence it)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
romaricpascalcommented, Sep 28, 2022

Maybe using a named export would make the warning disappear, as it seems to complain about the export being a default one. If that’s the case, that might be a cheap, quick fix for the warning 😄

0reactions
querkmachinecommented, Oct 3, 2022

Maybe this is something to discuss as a team? At the very least I’d like to check in with @querkmachine and see how it would feel about making it public now.

I don’t think there’s anything stopping I18n from being public.

It’s been built around the needs of our existing components and is definitely not the most fully-featured i18n script around (no genders, contextual grammar, etc.), so external users may run into the limitations of it harder than we have, but it does work (🤞).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Respond to Rollup warning for i18n.mjs - PullAnswer
This notice, which we think is coming from Rollup, currently appears in the test output: Entry module “src/govuk/i18n.mjs” is implicitly using “default” export...
Read more >
intl-messageformat throwing warnings · Issue #12 - GitHub
I'm currently building a small app using the basic rollup svelte template, and svelte-i18n, and rollup is currently throwing the following warning when...
Read more >
Compiling React component with rollup is returning webpack ...
I'm trying to compile a React jsx components throught Rollup.js to fill my components library in commonjs. This is my rollup configuration
Read more >
typesafe-i18n - npm
The rollup plugin removes these types from the translations in order to reduce bundle size by a few bytes. The example above will...
Read more >
referenceerror: i18n is not defined - You.com | The search engine ...
I am using react with rails, I installed I18n gem. I created a container which contains some component. This is my container example:...
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