Problems with prerendering

Hello all,
I have several problems when trying to prerender to a www output target.
One thing is that I may get different results for every build I run.
Sometimes the HTML and CSS are rendered but with no JS, so whatever is supposed to happen dynamically on the client just isn’t working.
Other times I get this ugly flickering when the page loads and some components are not rendered, mainly icons and ion-slides.
Also I have an ion-textarea which is rendered with this in it: <!--t.>.
Every once in a while I get a properly working build…

This is my Stencil config:

export const config: Config = {
  globalStyle: 'src/global/app.scss',
  globalScript: 'src/global/app.ts',
  outputTargets: [
      type: 'www',
      // comment the following line to disable service workers in production
      serviceWorker: null,
      baseUrl: 'https://myapp.local/', // this is the value from the stencil init command. Tried changing it but to no avail
      prerenderConfig: './prerender.config.ts',
  plugins: [

And this is my package.json:

  "name": "porfolio",
  "private": true,
  "version": "0.0.1",
  "description": "Stencil App Starter",
  "scripts": {
    "build": "stencil build",
    "build:s": "stencil build --prerender --verbose",
    "build:p": "stencil prerender dist/hydrate/index.js",
    "start": "stencil build --dev --watch --serve",
    "test": "stencil test --e2e test.e2e.ts",
    "": "stencil test --spec --e2e --watchAll",
    "generate": "stencil generate"
  "devDependencies": {
    "@stencil/core": "^2.6.0",
    "@stencil/router": "^1.0.1",
    "@stencil/sass": "^1.4.1",
    "@types/jest": "^26.0.24",
    "@types/puppeteer": "1.19.0",
    "jest": "^26.6.3",
    "jest-cli": "^26.6.3",
    "puppeteer": "1.19.0"
  "license": "MIT",
  "dependencies": {
    "@ionic/core": "^5.6.13"

The entire repo can be found here.

Let me know if I can provide any more info to help solve this.
Thanks a lot! :pray: