# 404 response at \`implicit/bundle.js\` when using okta-react library

**URL:** <https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374>\
**Category:** Questions\
**Created:** [June 11, 2019, 6:12pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374 "2019-06-11T18:12:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nryoung](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nryoung](https://devforum.okta.com/u/nryoung)\
**Post date:** [June 11, 2019, 6:12pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/1 "2019-06-11T18:12:08Z")

</div>

I am using the `okta-react` library to attempt to auth with my application. However, when I am getting redirected back to my application the `ImplicitCallback` component is attempting to redirect to `http://localhost:6002/implicit/bundle.js` which obviously doesn’t exist.

Here are the versions I am using:

`@okta/okta-react`: `v1.2.0`  
`react-router-dom`: `v4.3.1`  
`react-router`: `v4.3.1`  
`react`: `v16.8.6`  
`webpack`: `v4.29.6`

Here is my minimal setup

**index.jsx**

```
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom';
import { Security } from '@okta/okta-react';

import App from './App';
import Loading from './common/components/Loading';

const AppWithOkta = () => {
  const oktaConfig = { <okta values are here> };
  if (!oktaConfig) {
    return <Loading />;
  }
  return (
    <Router>
      <Security issuer={oktaConfig.issuer} client_id={oktaConfig.clientId} redirect_uri={oktaConfig.redirectUri}>
        <App />
      </Security>
    </Router>
  );
};

ReactDOM.render(<AppWithOkta />, global.document.getElementById('root'));

```

**app.jsx**

```
import React from 'react';
import { hot } from 'react-hot-loader/root';
import { Switch, Route } from 'react-router-dom';
import { SecureRoute, ImplicitCallback } from '@okta/okta-react';

import SecureComponent from './secure-component';
import OtherSecureComponent from './other-secure-component';
import Login from './common/components/Login';

const App = () => (
  <Switch>
    <Route path="/implicit/callback" component={ImplicitCallback} />
    <Route path="/login" component={Login} />
    <SecureRoute path="/some-route" exact component={SecureComponent} />
    <SecureRoute path="/other-route" exact component={OtherSecureComponent} />
  </Switch>
);

export default hot(App);

```

Whenever I login to okta I get these two requests / responses (obfustcated obviously so as not to share secrets:

**First call to `/implicit/callback`:**

 ![16%20PM](https://global.discourse-cdn.com/oktadev/original/2X/c/c534b8d90bd7e3fd0e381dd6ad25e9305a88c348.png)

**Invalid call to `/implicit/bundle.js`:**

 ![45%20PM](https://global.discourse-cdn.com/oktadev/original/2X/a/a8128e4aa1b962a9bd486baa62aa5b7dafda9394.png)

I am not sure why it would be trying to redirect to `/implicit`, I am wondering if this is a routing/redirect bug within the `okta-react` library?

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [June 11, 2019, 6:13pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/2 "2019-06-11T18:13:44Z")

</div>

Can you try adding `<base href="/" />` to the top of your `index.html` and see if that helps?

---

<div class="post-metadata">

**Author:** ![nryoung](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nryoung](https://devforum.okta.com/u/nryoung)\
**Post date:** [June 11, 2019, 6:18pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/3 "2019-06-11T18:18:19Z")

</div>

Holy crap! That worked!!! I have been spending days trying to figure out what is causing this… is this listed in the docs anywhere? This was brutal

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [June 11, 2019, 7:11pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/4 "2019-06-11T19:11:29Z")

</div>

It’s not really an Okta-specific thing, so it’s not in our docs. It’s more of something I’ve learned from my many years of web development. 😉

If you think there would be a good place to add it in our docs, please let me know and I’ll do so.

---

<div class="post-metadata">

**Author:** ![nryoung](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nryoung](https://devforum.okta.com/u/nryoung)\
**Post date:** [June 11, 2019, 7:22pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/5 "2019-06-11T19:22:34Z")

</div>

Fair enough. I have never run in to this issue writing a SPA before where I had to add that tag, I only ran in to this with the `okta` library. I do think it would be nice to mention in the main documentation or in the troubleshooting steps.

---

<div class="post-metadata">

**Author:** ![Fieel](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/fieel/32/1320_2.png) [@Fieel](https://devforum.okta.com/u/Fieel)\
**Post date:** [September 5, 2019, 12:16pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/6 "2019-09-05T12:16:49Z")

</div>

> [@mraible](#):
>
> `<base href="/" />`

It’s a standard when developing SPA, but yeah i agree docs should be updated just for the saké of it

---

<div class="post-metadata">

**Author:** ![naveen800](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@naveen800](https://devforum.okta.com/u/naveen800)\
**Post date:** [April 3, 2020, 4:19pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/7 "2020-04-03T16:19:52Z")

</div>

@mraible, can you please help me out with similiar situation, my localhost is working as expected but when i delpoy code on PROD receiving error message.

Note: Code deployed on Apache HTTPD server

1. Login works as expected
2. redirect to OKTA login page
3. After signin from OKTA received below error message

Not Found  
The requested URL /archivedb/implicit/callback was not found on this server.Error: Cannot match any routes. URL Segment: ‘implicit/callback’

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 3, 2020, 4:48pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/8 "2020-04-03T16:48:45Z")

</div>

If you’re using Apache in production, you need to configure it to serve up a SPA. That is, you need to configure it so all 404s go to index.html. I googled “configure apache for spa” and [here’s the first result](https://gist.github.com/santthosh/7dabf08fa3859361ef1e).

---

<div class="post-metadata">

**Author:** ![naveen800](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@naveen800](https://devforum.okta.com/u/naveen800)\
**Post date:** [April 3, 2020, 4:56pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/9 "2020-04-03T16:56:34Z")

</div>

@mraible thanks for response, even I followed this instruction but not working. Here is my rewrite rule:  
\<Directory “/archivedb/”\>  
Options Indexes MultiViews Includes  
AllowOverride All  
Order allow,deny  
Allow from all

```
AddType application/vnd.ms-fontobject .eot
AddType font/truetype .ttf
AddType application/x-font-woff .woff
AddType font/opentype .otf

```

 RewriteEngine On #RewriteBase /archivedb/ RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule ^.\*$ - [NC,L] RewriteRule ^(.\*) index.html [NC,L] #RewriteRule . /index.html [L] 

 ![Screen Shot 2020-04-03 at 1.03.57 PM](https://global.discourse-cdn.com/oktadev/original/2X/2/28defe5a9bd005cdb88ac8d13efdc9c525c885e7.png)

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 3, 2020, 5:29pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/10 "2020-04-03T17:29:00Z")

</div>

Maybe [this Stack Overflow Q&A](https://stackoverflow.com/questions/54897317/apache-settings-for-spa-using-html5-history-routing) will help?

---

<div class="post-metadata">

**Author:** ![naveen800](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@naveen800](https://devforum.okta.com/u/naveen800)\
**Post date:** [April 3, 2020, 6:00pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/11 "2020-04-03T18:00:58Z")

</div>

Sorry still no luck, IF update this below rule on httpd.conf

\<Directory ~ “^/[\w+\d±]+”\>  
FallbackResource /index.html

500 Internal Server Error
# Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 3, 2020, 6:39pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/12 "2020-04-03T18:39:45Z")

</div>

I’m sorry, I’m not an Apache expert. I’d suggest you ask a question on Stack Overflow where some experts probably exist.

---

<div class="post-metadata">

**Author:** ![naveen800](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@naveen800](https://devforum.okta.com/u/naveen800)\
**Post date:** [April 3, 2020, 6:59pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/13 "2020-04-03T18:59:05Z")

</div>

Ok thanks for your help, let me try on Stack Overflow

---

<div class="post-metadata">

**Author:** ![naveen800](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@naveen800](https://devforum.okta.com/u/naveen800)\
**Post date:** [April 5, 2020, 11:35pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/14 "2020-04-05T23:35:49Z")

</div>

@mraible ,

Issue resolved by following below link:

> [@Configuring the Angular router to \`useHash: true\` breaks \`OktaAuthService.loginRedirect\`](https://devforum.okta.com/t/configuring-the-angular-router-to-usehash-true-breaks-oktaauthservice-loginredirect/7374/3):
>
> We have the same issue, on a new Application. Issue was reported on December. Do we have any feedback on this issue? Any ideas for fixing the problem? Quit important as we need to move our existing App from Cognito AWS to OKTA, thus we need to find a solution. Thanks in advance for any feedback!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 24, 2024, 7:05pm UTC](https://devforum.okta.com/t/404-response-at-implicit-bundle-js-when-using-okta-react-library/5374/15 "2024-01-24T19:05:27Z")

</div>

Closed on January 24, 2024, 7:05pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
