I have an angular 7 application and have made a universal version of the application (SSR for SEO purpose).
The application runs all smooth like before, all data from API are displayed perfectly in local mode as well as in server.
The issue is however when I view the "Page Source" on the browser the API data is not visible in browser if fetched from server.
package.json
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"compile:server": "webpack --config webpack.server.config.js --progress --colors",
"serve:ssr": "node dist/server",
"build:ssr": "npm run build:client-and-server-bundles && npm run compile:server",
"build:client-and-server-bundles": "ng build --prod && ng run nthexam:server:production",
},
The command npm run build:ssr:stage && npm run serve:ssr build the SSR application and it works perfectly fine in local machine.
ISSUE
The page source on the browser do not show API data if SSR is deployed in server (ubuntu) however for static content its works all fine.
In local its works perfectly for static as well as API data, both are visible in page source in localhost.
After some search: I am using cloudflare, I tried by disabling all the cache, still of no use.
I tried this : Link But in few pages where I don't have any console error even then it don't show the data in page source, and local it works perfectly fine irrespective of the stated error.