# Okta-signin-widget - Can't make it work with webpack in an app where jQuery is already injected

**URL:** <https://devforum.okta.com/t/okta-signin-widget-cant-make-it-work-with-webpack-in-an-app-where-jquery-is-already-injected/14494>\
**Category:** Questions\
**Created:** [June 2, 2021, 1:06pm UTC](https://devforum.okta.com/t/okta-signin-widget-cant-make-it-work-with-webpack-in-an-app-where-jquery-is-already-injected/14494 "2021-06-02T13:06:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afaya](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@afaya](https://devforum.okta.com/u/afaya)\
**Post date:** [June 2, 2021, 1:06pm UTC](https://devforum.okta.com/t/okta-signin-widget-cant-make-it-work-with-webpack-in-an-app-where-jquery-is-already-injected/14494/1 "2021-06-02T13:06:38Z")

</div>

### Background info

We have a React app already configured and working with webpack.  
This app has already a jquery dependency:

“jquery”: “3.4.1”,

That jquery is both exposed with expose-loader and loaded with ProvidePlugin:

module: {  
rules: [  
…  
{  
test: require.resolve(“jquery”),  
loader: “expose-loader”,  
options: {  
exposes: [“$”, “jQuery”],  
},  
…  
]  
},  
plugins: [  
…  
new webpack.ProvidePlugin({  
$: “jquery”,  
jQuery: “jquery”,  
}),  
]

When adding the okta-sign-widget, webpack fails to build.  
Seems an error related to conflicts in the jQuery version and we can’t find a way to fix this

### Expected behavior

That we can add and use signin widget with webpack without any major problem

### What went wrong?

Webpack error log  
[0] TypeError: r.default.ajaxSetup is not a function  
[0] at Object.call (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\node\_modules@okta\courage\src\util\jquery-wrapper.js:4:1)  
[0] at **webpack\_require** (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\webpack\bootstrap f7e6bda01b7d30b21656:19:1)  
[0] at Object.call (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\node\_modules@okta\courage\src\models\SchemaProperty.js:2:1)  
[0] at **webpack\_require** (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\webpack\bootstrap f7e6bda01b7d30b21656:19:1)  
[0] at Object.call (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\node\_modules@okta\courage\src\models\BaseSchema.js:4:1)  
[0] at **webpack\_require** (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\webpack\bootstrap f7e6bda01b7d30b21656:19:1)  
[0] at Object.call (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\src\CourageForSigninWidget.js:3:1)  
[0] at **webpack\_require** (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\webpack\bootstrap f7e6bda01b7d30b21656:19:1)  
[0] at Object.call (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\okta-sign-in.entry.js:6696:20)  
[0] at t (C:\MyApp\node\_modules@okta\okta-signin-widget\dist\js\webpack:\webpack:\webpack\bootstrap f7e6bda01b7d30b21656:19:1)

### Steps to reproduce

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo if possible (you can use this template as a starting point: [Edit fiddle - JSFiddle - Code Playground](https://jsfiddle.net/m2gyLq4v/)).

### Your environment

- Okta Sign-In Widget Version: tried 5.5.0 and 5.7.0
- Browser: all
- OS: Windows 10
- Language: English

---

<div class="post-metadata">

**Author:** ![afaya](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@afaya](https://devforum.okta.com/u/afaya)\
**Post date:** [June 2, 2021, 1:47pm UTC](https://devforum.okta.com/t/okta-signin-widget-cant-make-it-work-with-webpack-in-an-app-where-jquery-is-already-injected/14494/2 "2021-06-02T13:47:02Z")

</div>

Just as an update, if I do remove the ProvidePlugin and expose-loader stuff from webpack (which I did just for testing), I still get the same error

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 8, 2024, 6:20pm UTC](https://devforum.okta.com/t/okta-signin-widget-cant-make-it-work-with-webpack-in-an-app-where-jquery-is-already-injected/14494/3 "2024-02-08T18:20:46Z")

</div>


