lundegaard / lundegaard/react-union

History api fallback does not handle `index.ejs`

Open
#398 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
96
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hi,
First of all. Thanky you for your job! 🙂

I already spend few hours with unsuccessful configuring of `historyApiFallback`

So I set in `union.config.js`:
```
devServer: {
historyApiFallback: true,
},
```

It look that it works well, but problem is that `history-api-fallback` serve `index.html` as default and not `index.ejs`

so if i rename `index.ejs` to `index.html` and `history-api-fallback` starts to work only for nested path (like `localhost:3300/a/b`) because root still goes to `index.ejs`

so I added to `union.config.js`:
```
templateFilename: 'index.html',
```

Now it looks like that it works but if I go to:
`localhost:3300/something/id/something`

it does not render and load any wigets. (maybe some bad relative paths of `

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the union.config.js settings for devServer.historyApiFallback and templateFilename, then reproduce the root and nested URL cases described in the report. Compare index.ejs and index.html behavior, including whether widgets load at nested paths; done means history fallback serves the intended template and the widgets render correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
devtools, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.