schibsted / account-sdk-browser

Schibsted Account SDK for browsers
https://schibsted.github.io/account-sdk-browser/
MIT License
16 stars 11 forks source link

Create React App won't build #13

Closed bukowskiadam closed 6 years ago

bukowskiadam commented 6 years ago

Hi there,

we're trying to use your library and it works properly in development mode. For production build we get an error:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/@schibsted/account-sdk-browser/src/validate.js:25

Read more here: http://bit.ly/2tRViJ9

Npm package does not contain transpiled files. I've cloned your repo, ran npm run build and modified in package.json main => dist/generated file, then I've linked my local copy to the create react app and it builds properly now.

I'm not sure is this a proper fix for this issue. If you have any concerns then feel free to contact me on our internal slack or here.

bukowskiadam commented 6 years ago

Resolved in 3.0.0-beta.7. To properly use it with Create React App use es5 dist files, e.g.:

import Identity from '@schibsted/account-sdk-browser/es5/identity';

Thanks @torarvid for fixing it!