Open denisyilmaz opened 1 year ago
Just to make sure I did not make a mistake here. The origin is set in the express/vite.config.ts
file:
import { nodeServerAdapter } from '@builder.io/qwik-city/adapters/node-server/vite';
import { extendConfig } from '@builder.io/qwik-city/vite';
import baseConfig from '../../vite.config';
export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
origin: 'https://www.example.com',
rollupOptions: {
input: ['src/entry.express.tsx', '@qwik-city-plan'],
},
},
plugins: [nodeServerAdapter({
name: 'express',
ssg: {
include: [],
origin: 'https://www.example.com',
}
})],
};
});
and not as mentioned in #3642 via the a environment
variable directly.
i can see it working
Sorry, i forgot to update the issue. Actually the env ORIGIN
was required on the node express server additionally to the settings on the vite config file. With this my globalAction$
was working. Changing it to a routeAction$
without any other change is causing a reload still.
I'm trying to find a pattern here and will get back if this persists.
Also: the action is transmitting a CSRF token to the backend which does not get validated. The token is generated by requesting it in the same action through a GET request to the server. I don't understand why it's not validated but this might be a config error with the backend though…
Just posting this here as this might give insights were my setup is flawed.
Which component is affected?
Qwik City (routing)
Describe the bug
I have a little "Newsletter Subscribe" Form that has a single email input field. On submit the
globalAction$
/routeAction$
calls a fetch function (one withGET
and one viaPOST
) to subscribe the email to our newsletter list. Locally this is working fine, even withnpm run build && npm run deploy
with the express adapter. But once deployed to the production server the page reloads on submit. The origin is set in theexpress/vite.config.ts
and i explicitly setreloadDocument
to false.Here is the component:
Reproduction
https://www.ynm.studio/
Steps to reproduce
Click
Notify me
and add email address. On Submit the page reloads and nothing happens.System Info
Additional Information
No response