Skip to content

Commit

Permalink
[bugfix] Revert changes made for #5269 due to webpack warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed May 1, 2020
1 parent 226799e commit 2e26863
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/locale/locales.js
Expand Up @@ -64,8 +64,7 @@ function chooseLocale(names) {

function loadLocale(name) {
var oldLocale = null,
aliasedRequire,
localePath;
aliasedRequire;
// TODO: Find a better way to register and load all the locales in Node
if (
locales[name] === undefined &&
Expand All @@ -76,10 +75,7 @@ function loadLocale(name) {
try {
oldLocale = globalLocale._abbr;
aliasedRequire = require;
localePath = (typeof __dirname !== 'undefined' ? __dirname : '.') +
'/locale/' +
name;
aliasedRequire(localePath);
aliasedRequire('./locale/' + name);
getSetGlobalLocale(oldLocale);
} catch (e) {
// mark as not found to avoid repeating expensive file require call causing high CPU
Expand Down

3 comments on commit 2e26863

@tinyfly
Copy link

@tinyfly tinyfly commented on 2e26863 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing the Can't resolve './locale' warning as mentioned in #5472 with 2.25.1

@Nick-Angel
Copy link

@Nick-Angel Nick-Angel commented on 2e26863 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi I'd like to report that I'm also experiencing a critical dependency error related to this most recent update to moment; Has there been any progress in resolving this issue? Thanks!

@shenenya
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change from

import moment from "moment";

to

import * as moment from "moment/moment";

That work for me. Hope it helps.

Please sign in to comment.