Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

__ion-dev-server scripts injecting is not compatible with path locationStrategy #1059

Open
bartcich opened this issue Jun 26, 2017 · 1 comment

Comments

@bartcich
Copy link

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

I'm using path location strategy in Ionic app:

IonicModule.forRoot(MyApp, {
  locationStrategy: 'path'
}),

with nested IonicPage segments (ex. /users/add). All scripts (like chunks 0.main.js etc) are loaded by realitve paths so in my example browser tries to load /users/build/0.main.js. This can be fixed just by adding <base href="/"> at the top of <head>. But in ionic serve there are scripts injected just at the top of of <head> so they're always before <base href="/">, so they're 404'ed:

<link href="__ion-dev-server/ion-dev.css?v=1.3.8" rel="stylesheet">
<script src="__ion-dev-server/ion-dev.js?v=1.3.8"></script>

What behavior are you expecting?

If all the script should be loaded by relative paths (as it is now), __ion-dev-server should be injected at the end of </head>

Steps to reproduce:

  1. Set locationStrategy to path in your app config
  2. Add page with nested segment (ex. /users/add) -(but I'm using nested tabs view)
  3. ionic serve
  4. Open nested page by entering url http://localhost:8100/users/add - in console you'll see 404 for all js and css files
insert any relevant code between the above and below backticks

Which @ionic/app-scripts version are you using?
1.3.8

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

@longgt
Copy link

longgt commented Nov 20, 2017

#916

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

No branches or pull requests

2 participants