nvh95/react-linkedin-login-oauth2

unexpected token

deepdil-sp opened this issue · 11 comments

.btn-linkedin {
^

SyntaxError: Unexpected token .
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)

nvh95 commented

@deepdil-sp Thanks for your feedback. Can you provide a little more information like steps to reproduce this issue?

its a server side rendering, so when i use igot this error.

Same issue here, i'm using next.js and getting this error during the build

Same issue here using next.js . Does any one have a way to fix it? Thanks in advance !

nvh95 commented

This issue just got fixed in 1.0.9-alpha.0. Please help to reinstall by running

npm i react-linkedin-login-oauth2@alpha

or

yarn add react-linkedin-login-oauth2@alpha

The 1.0.9 will come in a few days. Thanks

nvh95 commented

@all-contributors please add @deepdil-sp for bug

@nvh95

I've put up a pull request to add @deepdil-sp! 🎉

I got a same issue, I installed 1.0.9-alpha.0 but still not working

I got a same issue with the latest version as well. Is there any solution to this?

nvh95 commented

Please give it a try by running:

npm i react-linkedin-login-oauth2@alpha

See the usage at

## Usage
First, we create a button and provide required props:
```js
import React, { useState } from 'react';
import { useLinkedIn } from 'react-linkedin-login-oauth2';
// You can use provided image shipped by this package or using your own
import linkedin from 'react-linkedin-login-oauth2';
function LinkedInPage() {
const { linkedInLogin } = useLinkedIn({
clientId: '86vhj2q7ukf83q',
redirectUri: `${window.location.origin}/linkedin`, // for Next.js, you can use `${typeof window === 'object' && window.location.origin}/linkedin`
onSuccess: (code) => {
console.log(code);
},
onError: (error) => {
console.log(error);
},
});
return (
<img
onClick={linkedInLogin}
src={linkedin}
alt="Sign in with Linked In"
style={{ maxWidth: '180px', cursor: 'pointer' }}
/>
);
}
```

Please let me know if the problem is still persist. Thanks.

nvh95 commented

I believe this issue is resolved in 2.0.0. Please let me know if it persists