Skip to content

Webpack errors on serve and build. #74

Closed
@brianmcallister

Description

@brianmcallister

I'm seeing some errors that appear to be related to webpack when I run serve and build. Here's a sample repository (this link is to a tag I created, in case I make any changes between now and when somebody gets a chance to take a look): https://github.com/brianmcallister/functions-test/releases/tag/test-build

Here's what I'm seeing:

When I run npx netlify-lambda serve ., I see the following message:

netlify-lambda: Starting server
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
   -> The entry point(s) of the compilation.
   Details:
    * configuration.entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.
    * configuration.entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration.entry should be an array:
      [non-empty string]
Lambda server is listening on 9000

...and when I GET localhost:9000/test, the server is responding correctly.

However, when I run npx netlify-lambda build ., I see the following:

netlify-lambda: Building functions
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
   -> The entry point(s) of the compilation.
   Details:
    * configuration.entry should be an instance of function
      -> A Function returning an entry object, an entry string, an entry array or a promise to these things.
    * configuration.entry should not be empty.
      -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
      -> An entry point without name. The string is resolved to a module which is loaded upon startup.
    * configuration.entry should be an array:
      [non-empty string]
    at webpack (/Users/brianmcallister/projects/functions-test/node_modules/webpack/lib/webpack.js:31:9)
    at /Users/brianmcallister/projects/functions-test/node_modules/netlify-lambda/lib/build.js:93:5
    at new Promise (<anonymous>)
    at Object.exports.run (/Users/brianmcallister/projects/functions-test/node_modules/netlify-lambda/lib/build.js:92:10)
    at Command.<anonymous> (/Users/brianmcallister/projects/functions-test/node_modules/netlify-lambda/bin/cmd.js:51:8)
    at Command.listener (/Users/brianmcallister/projects/functions-test/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:180:13)
    at Command.parseArgs (/Users/brianmcallister/projects/functions-test/node_modules/commander/index.js:654:12)
    at Command.parse (/Users/brianmcallister/projects/functions-test/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/Users/brianmcallister/projects/functions-test/node_modules/netlify-lambda/bin/cmd.js:61:9)

According to the documentation, it doesn't appear as though I need to provide any custom webpack config at all, but let me know if I'm misunderstanding something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions