After upgrading auth0-lock to 10.12.0, I am seeing the following error when building my project using webpack (1.14.0):
ERROR in ./bundle.js from UglifyJs
SyntaxError: Unexpected token: name (Core) [./~/auth0-lock/lib/index.js:7,0]
Lock import code:
import Auth0Lock from 'auth0-lock'
Versions:
My current workaround is to use 10.11
@swarajban can you provide a sample where we can try to see why it's breaking your config since we lack the information from your either your description or workaround?
We recently migrated to webpack 2 but that should not affect your build and the transpile task was not changed significantly to break it.
@swarajban I sort of reproduced it (got an error from the import instead of Core) but might be related, any more info is appreciated. Also using webpack 2 should also fix this.
@hzalaz I'm also getting an error from the import:


I'm simply importing the module in my own code:
import Auth0Lock from 'auth0-lock'
webpack: 1.13.1
node: 6.9.5
os: MacOS 10.12.2
Here is a link to a project that demonstrates the error: https://dl.dropboxusercontent.com/u/5826539/lock-error.zip
Steps
cd innpm installnpm run build-prodSee error:
ERROR in build.js from UglifyJs
SyntaxError: Unexpected token: name (Core) [./~/auth0-lock/lib/index.js:7,0]
The project is based of the /examples/bundling/webpack project in this repo
I confirm this issue. The previous version of auth0-lock library was transpiled to use require and now it's using import.
Tagged code that demonstrates this issue: https://github.com/codefortulsa/courtbook/releases/tag/auth0-lock-issue-892
My build failing in Travis: https://travis-ci.org/codefortulsa/courtbook/builds/207242110
Thanks, reproduced this in my end and working on a fix
Should be fixed with latest release v10.12.1. Tried it with the webpack 1 example in the repo and it works
@hzalaz works great, thanks for the quick turnaround! Feel free to close
Most helpful comment
Thanks, reproduced this in my end and working on a fix