Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare-versions error when upgrading from version 4.1.0 to 6.5.0 #238

Open
teernisse opened this issue Jun 22, 2022 · 4 comments
Open

compare-versions error when upgrading from version 4.1.0 to 6.5.0 #238

teernisse opened this issue Jun 22, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@teernisse
Copy link

Describe the bug?

I'm trying to update my project from version 4.1.0 of okta-react to 6.5.0 and version 4.4.0 of okta-auth-js to 6.7.0, but no matter what I do the following error appears:

ERROR in ./node_modules/@okta/okta-react/bundles/okta-react.esm.js 131:28-35
"export 'compare' was not found in 'compare-versions'
@ ./src/components/Okta/OktaSecurityConsumer.tsx
@ ./src/components/Okta/OktaSecurity.tsx
@ ./src/components/Okta/index.ts
@ ./src/routing/Router.tsx
@ ./src/index.tsx
@ multi ./config/polyfills.js ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.tsx

What is expected to happen?

I expected the errors created by the update to be fixable in my own code.

What is the actual behavior?

The above error appears from within the okta-react package with no obvious cause or way to fix.

Reproduction Steps?

I'm not sure whether this can be reproduced, but all I did to get this error to appear was upgrade a project with an okta-react integration from 4.1.0 to the latest version of okta-react.

SDK Versions

@okta/okta-react: 4.1.0 -> 6.5.0
@okta/okta-auth-js: 4.4.0 -> 6.7.0

Execution Environment

NodeJS v. 14.15.1

Additional Information?

I've tried switching to Node 16 as well as trying various combinations of the two okta packages we're using, but nothing I've tried has influenced the error in any way.

@teernisse teernisse added the bug Something isn't working label Jun 22, 2022
@jaredperreault-okta
Copy link
Contributor

How are you bundling/building your React app? react-scripts? vite?

@teernisse
Copy link
Author

I'm using webpack, previous owners of the codebase ejected from create-react-app.

@jaredperreault-okta
Copy link
Contributor

If you don't care about using ES modules, you can specify the umd bundle in your webpack config

resolve: {
    alias: {
      '@okta/okta-react': path.resolve(__dirname, 'node_modules/@okta/okta-react/okta-react.umd.js')
    }
  },

If you do want to use ES modules, you may need to adjust your webpack version and/or config to consume them correctly

@teernisse
Copy link
Author

I got the same suggestion from a ticket I opened with Okta Support around the same time as your first followup question. I'll keep fiddling with the webpack config; this project is super out of date package-wise and it's been quite the headache to update. Thanks for the input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants