You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@brianmcallister I have been experiencing the same and solved it by specifying entry points with entry: glob.sync('./*.(ts|js)', { cwd: process.cwd() + <path_to_functions> }).reduce((o, key) => ({ ...o, [key.replace(/\.(m?js|ts)$/, '')]: key }), {}).
@brianmcallister its been a while - gonna close for now - feel free to reopen if any issues
fwiw everyone here i ran into this issue myself today and figured out it was because i was accidentally nesting my functions inside folders - so i proposed this console message to make the error a bit friendlier: #84
I'm seeing some errors that appear to be related to webpack when I run
serve
andbuild
. 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-buildHere's what I'm seeing:
When I run
npx netlify-lambda serve .
, I see the following message:...and when I
GET localhost:9000/test
, the server is responding correctly.However, when I run
npx netlify-lambda build .
, I see the following: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.
The text was updated successfully, but these errors were encountered: