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

Incorrect Types in WidgetOptions / parseSchema #3603

Open
bryanbraun opened this issue Apr 16, 2024 · 1 comment
Open

Incorrect Types in WidgetOptions / parseSchema #3603

bryanbraun opened this issue Apr 16, 2024 · 1 comment
Labels

Comments

@bryanbraun
Copy link

Describe the bug

Using the parseSchema API described in the docs, is not supported by the WidgetOptions type, provided by @okta/okta-signin-widget. The error says property 'push' does not exist on type 'RegistrationSchema':

image

Despite the error, this option appears to still be supported by the widget. Here's the output from the console.log(schema) above (showing an array that supports push):

image


Possible cause:
It looks like these imported types are being sourced from /src/types/index.ts, whereas Okta's internal tests for this functionality (like src/v3/src/transformer/transaction/transform.test.ts), are importing types from src/v3/src/types/index.ts.

Reproduction Steps

Codesandbox example showing the type error: https://codesandbox.io/p/sandbox/okta-signin-widget-types-nk7q3r?file=%2Fsrc%2Foptions.ts%3A15%2C25

(this example shows the type error but isn't set up to log the schema value itself)

SDK Versions

System:
OS: macOS 14.1.1
CPU: (8) arm64 Apple M1 Pro
Memory: 78.94 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.14.0/bin/yarn
npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
pnpm: 8.6.0 - ~/.nvm/versions/node/v16.14.0/bin/pnpm
Browsers:
Chrome: 123.0.6312.124
Chrome Canary: 125.0.6422.0
Firefox Nightly: 126.0a1
Safari: 17.1
npmPackages:
@okta/okta-signin-widget: ^7.15.1 => 7.15.1

Additional Information

This issue may be connected to #2726, which is reporting other missing types.

@bryanbraun bryanbraun added the bug label Apr 16, 2024
@glenfannin-okta
Copy link
Contributor

@bryanbraun 👋 Thank you so much for this, I have created an internal ref to fix this type.

Internal ref: OKTA-720583

FYI, you may already know this, but if this error is blocking you you can use @ts-ignore until we deploy the type fix. As you can see it is in fact an array and you can safely use array operations on the property.

Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants