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

Cannot destrucutre property userWebpackConfig of 'undefined' or 'null' #156

Closed
bswank opened this issue May 18, 2019 · 5 comments
Closed

Comments

@bswank
Copy link

bswank commented May 18, 2019

When I use the latest version of this package with this repo, I receive the following error:

netlify-lambda: Starting server
/Users/bswank/Code/directoree/node_modules/netlify-lambda/lib/build.js:34
function webpackConfig(dir, {userWebpackConfig, useBabelrc}) {

TypeError: Cannot destructure property `userWebpackConfig` of 'undefined' or 'null'.
    at webpackConfig (/Users/bswank/Code/directoree/node_modules/netlify-lambda/lib/build.js:34:23)
    at Object.exports.watch (/Users/bswank/Code/directoree/node_modules/netlify-lambda/lib/build.js:154:26)
    at Command.<anonymous> (/Users/bswank/Code/directoree/node_modules/netlify-lambda/bin/cmd.js:55:11)
    at Command.listener (/Users/bswank/Code/directoree/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/Users/bswank/Code/directoree/node_modules/commander/index.js:651:12)
    at Command.parse (/Users/bswank/Code/directoree/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/Users/bswank/Code/directoree/node_modules/netlify-lambda/bin/cmd.js:99:9)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

Sorry if I'm missing something simple!

@mikeyhogarth
Copy link
Contributor

Can confirm that this is happening, don't think it's intentional - it has to do with this change;

86332fb

Which has inadvertedly made it mandatory to pass in additional webpack config - really simple fix (I'll put a PR in if I can get my kid to bed at a decent time) but in the meantime if you want to get unstuck, just temporarily do the following;

  1. Create webpack.config.temp.js in your root folder
  2. Put the following into it;
module.exports = {};
  1. Start the server with this;
netlify-lambda serve src/lambda --config webpack.config.temp.js

@bswank
Copy link
Author

bswank commented May 19, 2019

Thanks @mikeyhogarth! I tried that but without the --config flag to actually pass the webpack config. Just thought I was on the wrong track. Appreciate it!

@swyxio
Copy link
Contributor

swyxio commented May 19, 2019

we need typescript :(

@swyxio
Copy link
Contributor

swyxio commented May 19, 2019

released fix in v1.4.11

@omonk
Copy link
Contributor

omonk commented May 20, 2019

@sw-yx 🤦‍♂ my bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants