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.

How to suppress warning with __FEATURE_ESM_BUNDLER_WARN__ ?

See original GitHub issue

This might not be a bug, but maybe a missing part of the docs. I am using Vue 3 with Vue CLI and a vue.config.js. I had no luck adding it to chainWebpack like this, so how do I configure that flag?

  chainWebpack: config => {
    config.plugin('define').tap(args => {
      args[0] = {
         ...args[0],
         __FEATURE_ESM_BUNDLER_WARN__: false
      }
      return args
   })
  },

Module versions

  • “vue”: “^3.0.0”,
  • “vue-i18n”: “^9.0.0”,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
rstoenescucommented, May 25, 2021

Hi,

I don’t think this is fixed yet. Even if one sets all the necessary flags, on dev it will show the warning regardless, and this is because of the following:

// extract from dist/vue-i18n.esm-bundler.js

if ((process.env.NODE_ENV !== 'production') && typeof true === 'boolean') {
    // in dev, it'll always get in here so it will trigger the warning
    needWarn = true;
}

The part with typeof true === 'boolean' is because the vue-i18n build script always replaces __FEATURE_ESM_BUNDLER_WARN__ with true (in the source code). As displayed in the rollup.config.js (__FEATURE_ESM_BUNDLER_WARN__: true, ~line 238).

0reactions
Oleksii14commented, May 24, 2021

@Unkrass I have been importing vue-i18n incorrectly, now It’s fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to suppress Java compiler warnings for specific functions
Try to supress all the fall-through warning at the compiler level is a bad thing: as you've explained, the cases where you need...
Read more >
Suppress code analysis warnings - .NET - Microsoft Learn
This article covers the various ways you can suppress warnings from code analysis when you build your .NET app. You can suppress code ......
Read more >
Excluding warnings using @SuppressWarnings - IBM
Token Description Suppressed compiler option(s) all to suppress all warnings All compiler options cast to suppress warnings relative to cast operations Unnecessary cast or 'instance... deprecation...
Read more >
How to Suppress Warnings in R (With Examples) - Statology
You can use the following methods to suppress warnings in R: Method 1: Suppress Warnings on Specific Line suppressWarnings(one line of code).
Read more >
How to Disable a Warning in C++
How to disable a warning across the 3 major C++ compilers with the same code.
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