Azure / azure-functions-pack

Easily package your Node.js Functions for Azure Functions
MIT License
153 stars 31 forks source link

Error: Cannot find module . #80

Open andrewkdouglas opened 6 years ago

andrewkdouglas commented 6 years ago

Hi,

No matter what I try I hit the same bug while trying to use this package. funcpack pack ./ runs successfully, but trying to start the functions (on localhost or in Azure) results in the error "Error: Cannot find module ."

It seems to be comming from this code block in index.js (the one generated by funcpack)

var UglifyJS = exports;
var FILES = UglifyJS.FILES = [
    "../lib/utils.js",
    "../lib/ast.js",
    "../lib/parse.js",
    "../lib/transform.js",
    "../lib/scope.js",
    "../lib/output.js",
    "../lib/compress.js",
    "../lib/sourcemap.js",
    "../lib/mozilla-ast.js",
    "../lib/propmangle.js",
    "./exports.js",
].map(function(file){
    return /*require.resolve*/(!(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
});

This seems to be similar to https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/226 but I don't see why UglifyJS would be included by funcpack.

Thanks