Hello, I need your assistance.
I am using HTTPS connection for my local project.
While I am trying to run slice machine, I have "We cannot connect to https://localhost:3000/slice-simulator." error.
I can't run my local project on HTTP because I am using auth0 tools.
What should I do?
Code in slice-simulator.jsx
import { SliceSimulator } from "@prismicio/slice-simulator-react";
import { SliceZone } from "@prismicio/react";
import { components } from "../slices/index";
import state from "../.slicemachine/libraries-state.json";
const SliceSimulatorPage = () => {
return (
<SliceSimulator
sliceZone={({ slices }) => (
<SliceZone slices={slices} components={components} />
)}
state={state}
/>
);
};
export default SliceSimulatorPage;
Don't know if https will work but the page https://localhost:3000/slice-simulator is not meant to be for direct access. You have to run Slicemachine and view your slices from there.
@it14, as @jordy mentions, you should only access http://localhost:3000 to see Slice Machine. What is the reason you want to use HTTPS in a local environment?
I have communicated this with the team and this is what they think. One reason for this would be that slice-machine doesn’t have access to the SSL certificate, and the other would be that in our server, we only use express’s app.listen rather than
http.createServer(app)
https.createServer(app)
You'd need to use a proxy, like nginx to handle the https part and then pass it through to slicemachine (running http)