Moment erorr in kibana dev env

PSP: everything is ok in non-dev mode

after npm install, then I run ./bin/kibana --dev --no-ssl --no-base-path, after I refresh the chrome, I got below error later:

 WARNING in ./~/.2.13.0@moment/min/moment.min.js
    Module not found: Error: Cannot resolve 'file' or 'directory' ./locale in /Users/whoami/kibana/kibana/node_modules/.2.13.0@moment/min
     @ ./~/.2.13.0@moment/min/moment.min.js 6:3763-3785

    at Object.exports.create (/Users/whoami/kibana/kibana/node_modules/.2.8.0@boom/lib/index.js:21:17)
    at LazyOptimizer.failedStatsToError (/Users/whoami/kibana/kibana/src/optimize/base_optimizer.js:214:17)
    at Compiler.<anonymous> (/Users/whoami/kibana/kibana/src/optimize/lazy/lazy_optimizer.js:44:22)
    at Compiler.applyPlugins (/Users/whoami/kibana/kibana/node_modules/.0.1.10@tapable/lib/Tapable.js:26:37)
    at Watching._done (/Users/whoami/kibana/kibana/node_modules/.1.12.15@webpack/lib/Compiler.js:78:17)
    at Watching.<anonymous> (/Users/whoami/kibana/kibana/node_modules/.1.12.15@webpack/lib/Compiler.js:61:18)
    at /Users/whoami/kibana/kibana/node_modules/.4.1.11@graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:123:15)
Error: Optimizations failure.

I found some snippet in moment.js source:

    function loadLocale(name) {
        var oldLocale = null;
        // TODO: Find a better way to register and load all the locales in Node
        if (!locales[name] && (typeof module !== 'undefined') &&
                module && module.exports) {
            try {
                oldLocale = globalLocale._abbr;
                require('./locale/' + name);
                // because defineLocale currently also sets the global locale, we
                // want to undo that for lazy loaded locales
                locale_locales__getSetGlobalLocale(oldLocale);
            } catch (e) { }
        }
        return locales[name];
    }

seems kibana use moment.min.js (in moment/min), but there is no locale in moment/min, should kibana use moment-with-locales.min.js instead?

it seems its a bug? https://github.com/moment/moment/issues/1435

Hi @whoami,

Could you tell me which branch and commit SHA of Kibana you are working with? That way I can try to reproduce your error and investigate further.

Thanks,

Shaunak

kibana 5.2.0:

git clone kibana
npm install
./bin/kibana --dev --no-ssl --no-base-path

Hi @whoami,

I just tried to reproduce your issue with the 5.2 branch but was unsuccessful.

I ran npm ls | grep moment and got this output:

├── moment@2.13.0
├── moment-timezone@0.5.4

What output do you get if you run the same command?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.