BazingaJsTranslationBundle icon indicating copy to clipboard operation
BazingaJsTranslationBundle copied to clipboard

Uncaught ReferenceError: Translator is not defined

Open dubitoph opened this issue 3 years ago • 1 comments

Hello,

I'm using Symfony 5.1, webpack Encore 1.8 and bazinga-translator 4.0.1. I have this error :

Uncaught ReferenceError: Translator is not defined

Howerver, I import the module in the app.js like this :

import Translator from 'bazinga-translator';
window['Translator'] = Translator;

I don't understand this mistake.

dubitoph avatar Apr 30 '21 09:04 dubitoph

Hello,

I had the same issue, but I soved it via :

const Translator = require('bazinga-translator');
global.Translator = window.Translator = Translator;

GGarmy avatar Oct 19 '21 13:10 GGarmy