-
Notifications
You must be signed in to change notification settings - Fork 248
slash escaped with statically generated content #1252
Comments
These slashes are totally normal as our api server have static routes defined with specific parts for the path. Should not cause any troubles in practise. What are the actual error(s) you are facing? |
The server gets a request for My guess is that you |
What are you using for serving static version? |
Hi @MoOx, even for me this it's a bit strange. When serving the static content on When you manipulate the path, by replacing the |
Problem is that during development, I am not sure / will work for express dev server. |
The development server works fine; I guess it does some magic with |
Are you sure about development? Express routes for the api should not work... |
Interestingly I'm experiencing the same behaviour: it works fine with the development server as well as using |
Having the same problem! When I try to run with a simple web server against the dist folder I get hit with this error. |
@smurphy8 you can just omit the script tag at the bottom in a custom Html template https://github.com/phenomic/phenomic/blob/1a896add371a7903f9633457104f2caff78736c3/examples/react-app-blog/Html.js#L28 then the frontend won't try to load js, and you will basically have a html website (api will still be generated, but not used) |
Okay I will give that a try |
Well the problem is I am using the Reason/React app which does the Html rendering in I think? But I can't seem to build my own version of the preset app with the script tag taken out because I get a module not found error. Gonna keep trying but worried I am going down the wrong rabbit hole or something! |
You can just throw a custom Html.js, even if you use reasonml. This should work by just dropping a Html.js file at the root of your project :) |
is still being generated inside the |
It seems like the script that is calling the json is inside the body. My template looks like... // @flow
import * as React from "react";
import { Helmet } from "react-helmet";
import { AppRegistry } from "react-native-web";
const Html = ({ App, render }: PhenomicHtmlPropsType) => {
AppRegistry.registerComponent("App", () => App);
const app = AppRegistry.getApplication("App");
const { Main, State, Style } = render(app.element);
const head = Helmet.renderStatic();
return (
<html {...head.htmlAttributes.toComponent()}>
<head>
{head.meta.toComponent()}
{head.title.toComponent()}
{head.base.toComponent()}
{app.getStyleElement()}
<Style />
{head.link.toComponent()}
{head.style.toComponent()}
{head.script.toComponent()}
{head.noscript.toComponent()}
</head>
<body {...head.bodyAttributes.toComponent()}>
<Main />
<State />
</body>
</html>
);
};
export default Html; |
@smurphy8 try removing |
well that didn't work but I just modded my server to handle the %2F ... Fixed! |
Hi I am playing with the tutorial, the generated paths for the static version
npm run build
have incorrectly escaped slash%2F
It works if I manually edit it in the url:
It has
phenomic/content%2F
but it should havephenomic/content/
, not sure who is generationg those.My server does not magically unescape the escaped sequences.
The text was updated successfully, but these errors were encountered: