-
Notifications
You must be signed in to change notification settings - Fork 365
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
Bug: re-write rules are not applied for non static servers #1242
Comments
Just came across this on a project uses webpack-dev-server for local dev with a |
I think I've run into this issue too. I get # netlify.toml
[dev]
framework = "#custom"
command = "npm run serve"
targetPort = 8080
port = 3000
publish = "dist"
autoLaunch = false // package.json
"serve": "npx @11ty/eleventy --serve",
|
I too have also run into this issue, or something very similar. I get
My
Does anyone have any clues as to what's going on with this problem? Thanks |
I'm having this same issue with Svelte and svelte-navigator. # netlify.toml
[[redirects]]
from = "/*"
to = "/index.html"
status = 200 // package.json
"scripts": {
"dev": "npm run dev:rollup",
}
|
I have a simple 404 redirect which fails locally but works if deployed.
This is a direct lift from @philhawksworth demo. Clone https://github.com/andystevenson/wwsc.club to witness the problem. |
For static sites (without any detected framework), the URL is re-written here: Lines 243 to 251 in 73d9a6e
This doesn't happen when the |
Describe the bug
The following rule is not applied for non static servers (when a framework is detected):
To Reproduce
Steps to reproduce the behaviour:
git clone https://github.com/11ty/eleventy-base-blog.git test-project
cd test-project
npm install
rm 404.md
(this is important so 11ty won't redirect to a custom error page)echo "/* /index.html 200" > _redirects
BROWSER=none netlify dev
http://localhost:8888/test
See that you get an error from 11ty
Cannot GET /test/index.htm
Configuration
Expected behavior
The
index.html
file content should be returned.Additional context
Related to the discussion here #794 (comment) and to #810
The following does work:
I believe the test here passes since
create-react-app
re-routes unknown routes to the index page. Meaning the redirect is handled increate-react-app
.The solution is to request the resource from the framework server - if it returns 404 redirect, otherwise don't redirect.
The text was updated successfully, but these errors were encountered: