Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing lodash lib in prod #20

Closed
jonyrock opened this issue Oct 1, 2018 · 1 comment
Closed

Missing lodash lib in prod #20

jonyrock opened this issue Oct 1, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@jonyrock
Copy link
Member

jonyrock commented Oct 1, 2018

from production. https://github.com/CorpGlory/grafana-data-exporter/wiki/Getting-Started-Linux , grafana-data-exporter-0.3.3

I run $ node dist/server.js and get error:

module.js:549
    throw err;
    ^

Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.P (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:784:18)
    at __webpack_require__ (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:638:30)
    at fn (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:48:20)
    at Object.<anonymous> (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:696:11)
    at __webpack_require__ (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:638:30)
    at fn (/home/alex/grafana-data-exporter-0.3.3/dist/server.js:48:20)
@jonyrock jonyrock added the bug Something isn't working label Oct 1, 2018
@jonyrock
Copy link
Member Author

jonyrock commented Oct 1, 2018

@rozetko @amper43
such config works good for development, not production.
https://github.com/CorpGlory/grafana-data-exporter/blob/master/build/webpack.base.conf.js#L24

externals: [
    function(context, request, callback) {
      if(request[0] == '.') {
        callback();
      } else {
        callback(null, "require('" + request + "')");
      }
    }
  ],

but you keep in in base config

rozetko added a commit that referenced this issue Oct 1, 2018
* mv externals from base to dev webpack config

* rm unnecessary plugins from base webpack config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant