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.

Using 2.x with locales and webpack

See original GitHub issue

Is anyone successfully using the 2.x release with locales and webpack?

The following results in a Cannot read property 'delimiters' of undefined error:

import numeral from "numeral"
numeral.locale("nl-nl")

And when I try this

import numeral from "numeral"
import numeralnl from "numeral/locales/nl-nl"
numeral.register("locale", "nl-nl", numeralnl)
numeral.locale("nl-nl")

It throws the Uncaught TypeError: nl-nl locale already registered error.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

5reactions
pedroabreucommented, Jan 16, 2017

I’ve managed to make it work like this:

import numeral from "numeral"
import numeralen from "numeral/locales/en-gb"

numeral.locale("en-gb")

I was having the Cannot read property 'delimiters' of undefined issue as well.

Running on:

"webpack": "^1.13.2"
"numeral": "^2.0.4",
0reactions
sahin52commented, Oct 1, 2021

How do we get the locale? I can’t change locale if the locale is already the computer’s locale

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create multiple output paths in Webpack config
Webpack does support multiple output paths. Set the output paths as the entry key. And use the name as output template. webpack config:...
Read more >
DefinePlugin | webpack
The DefinePlugin replaces variables in your code with other values or expressions at compile time. This can be useful for allowing different behavior ......
Read more >
How To Use Custom webpack Configurations with Angular ...
js , moment-locales-webpack-plugin , and @angular-builders/custom-webpack . Step 2 — Building a Localized Clock Display. The example project for ...
Read more >
i18n - npm
Minimal example, just setup two locales and a project specific directory. ... Alternatively split creation and configuration, useful when split up ...
Read more >
API Reference - Webpack Loader (@lingui/loader) — LinguiJS ...
In case of using po format, use .po . export async function dynamicActivate(locale: string) { const { messages } = await import(`@lingui/loader!
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