panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Using within a create-react-app give a "classPrivateProperties isn't currently enabled" error #431

Closed lecoqlibre closed 2 years ago

lecoqlibre commented 2 years ago

Hi, when I try to use this library within a new Create React App project I get the following error :

/node_modules/openid-client/lib/client.js: Support for the experimental syntax 'classPrivateProperties' isn't currently enabled (163:3)

It seems that you are publishing experimental features on npm.

Is that intentional? Please consider reading this issue: Please don’t publish experimental syntax on npm.

Thanks.

How to reproduce this issue:

npx create-react-app my-app
cd my-app
yarn add openid-client

Add the following code into src/App.js:

import { Issuer } from 'openid-client';
const googleIssuer = Issuer.discover('https://accounts.google.com');
console.log('Discovered issuer %s %O', googleIssuer.issuer, googleIssuer.metadata);

Run yarn start

panva commented 2 years ago

There's nothing experimental and this is a Node.js only package.