During prerendering, global app script doesn't loaded

Open
#2,498 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Start by reproducing the issue with the provided PrerenderConfig, especially the entryUrls, beforeHydrate, and hydrateOptions settings, then trace how prerendering handles the global script compared with component lifecycle hooks. Done means the global script executes and logs during prerendering, with coverage for this behavior if the relevant test location is identified.

Written by the indexing model from the issue text.

Description

triage

Stencil version:

 @stencil/core@1.14.0

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

Try to console log something in global script and it is not printed. But it is printed in component lifecycle such as componentWillLoad or componentDidLoad.
Expected behavior:

should execute global script
Steps to reproduce:

import { PrerenderConfig } from '@stencil/core';
export const config: PrerenderConfig = {
    crawlUrls: false,
    entryUrls: ['/'],
    beforeHydrate: (_doc, url) => {
        console.log(url);
    },
    hydrateOptions: _url => {
        return {
            runtimeLogging: true
        };
    }
};

log something in gloabalScript will not shown, yet will shown in other components.
Related code:

// insert any relevant code here

Other information:

Dominant language
TypeScript
Stars
13.1k
Forks
855
Avg merge
4h 7m
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stenciljs/core

All issues in stenciljs/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.