# Can we have Lock 10 built for WebPack?

**URL:** <https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454>\
**Category:** Get Help\
**Tags:** lock-10, webpack\
**Created:** [October 11, 2017, 9:03pm UTC](https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454 "2017-10-11T21:03:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![claus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/claus/32/8905_2.png) [@claus](https://community.auth0.com/u/claus)\
**Post date:** [October 11, 2017, 9:03pm UTC](https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454/1 "2017-10-11T21:03:29Z")

</div>

I’m attempting to the the auth-lock node module working as per [instructions](https://auth0.com/docs/libraries/lock/v10), but while using `npm run build` works for the [webpack example](https://github.com/auth0/lock/tree/master/examples/bundling/webpack) I have not been able to build it for our much more complicated project.

Usually node modules come ready built, so the problem would be avoided if there was a built module (we can’t use the CDN).

Trying to do:

```
import Auth0Lock from '../../../grunt/v2/node_modules/auth0-lock/lib/index.js';

```

Brings up errors about missing modules, so we had to manually install:

```
npm i --save-dev babel-plugin-transform-css-import-to-string
npm i --save-dev babel-plugin-stylus-compiler
npm i --save-dev babel-preset-es2015
npm i --save-dev babel-preset-stage-0

```

This finally results in error:

```
ERROR in ./node_modules/auth0-lock/lib/index.js
Module build failed: ReferenceError: [BABEL] C:\dev\workspace\project\grunt\v2\node_modules\auth0-lock\lib\index.js: Unknown option: C:\dev\workspace\project\grunt\v2\node_modules\react\index.js.Children. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: {option: value}] }`
Valid:
  `{ presets: 'presetName', {option: value}]] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options. (While processing preset: "C:\\Utvikling\\ECE5.6\\workspace\\project\\grunt\\v2\\node_modules\\react\\index.js")
  at Logger.error (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\logger.js:41:11)
  at OptionManager.mergeOptions (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:226:20)
  at C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14
  at C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22
  at Array.map (native)
  at OptionManager.resolvePresets (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
  at OptionManager.mergePresets (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
  at OptionManager.mergeOptions (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
  at OptionManager.init (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
  at File.initOptions (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\index.js:212:65)
  at new File (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\file\index.js:135:24)
  at Pipeline.transform (C:\dev\workspace\project\grunt\v2\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
  at transpile (C:\dev\workspace\project\grunt\v2\node_modules\babel-loader\lib\index.js:49:20)
  at Object.module.exports (C:\dev\workspace\project\grunt\v2\node_modules\babel-loader\lib\index.js:171:20)
 @ C:/Utvikling/ECE5.6/workspace/project/src/js/modules/login.js 3:13-78
 @ C:/Utvikling/ECE5.6/workspace/project/src/js/all.js
 @ C:/Utvikling/ECE5.6/workspace/project/src/js/program.js

```

Already spent a day trying to just get Lock working, so hope that it might be possible to get a lock node-module that is ready for use with webpack.

---

<div class="post-metadata">

**Author:** ![claus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/claus/32/8905_2.png) [@claus](https://community.auth0.com/u/claus)\
**Post date:** [October 12, 2017, 7:17pm UTC](https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454/2 "2017-10-12T19:17:49Z")

</div>

Solved! I had to install babel-preset-react and the above error disappeared.

I do get this warning, so I’m not 100% happy, but now it works:

> [BABEL] Note: The code generator has  
> deoptimised the styling of  
> “C:/dev/workspace/project/grunt/v2/node\_modules/react-dom/cjs/react-dom.development.js”  
> as it exceeds the max of “500KB”.

Also, I see that the webpack example project was updated not long after I posted this which is nice, but I’m not sure what the plugin is supposed to do?

---

<div class="post-metadata">

**Author:** ![claus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/claus/32/8905_2.png) [@claus](https://community.auth0.com/u/claus)\
**Post date:** [October 17, 2017, 1:33pm UTC](https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454/3 "2017-10-17T13:33:24Z")

</div>

To avoid Babel trying to optimise the node modules add this to the rules:  
exclude: /node\_modules/,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/can-we-have-lock-10-built-for-webpack/8454/4 "2018-03-02T05:56:56Z")

</div>


