GithubHelp home page GithubHelp logo

Comments (2)

Fluccioni avatar Fluccioni commented on August 20, 2024 1

I have currently the same TypeError, but I'm not sure it has something to do with the use of setTimeout.

I came across this comment in the initEventReplay function saying we may encounter undefined reading 'ngContracts'.

If it is the case, therefore the const container will be undefined too and the error will be thrown on the invocation of getJsactionData.

// TODO: Upstream this back into event-dispatch.
function getJsactionData(container) {
    return container._ejsa;
}

const initEventReplay = (eventDelegation, injector) => {
    const appId = injector.get(APP_ID);
    // This is set in packages/platform-server/src/utils.ts
    // Note: globalThis[CONTRACT_PROPERTY] may be undefined in case Event Replay feature
    // is enabled, but there are no events configured in an application.
    const container = globalThis[CONTRACT_PROPERTY]?.[appId];
    const earlyJsactionData = getJsactionData(container);
    ...

The problem seems to be the bundle jsaction contract script not correctly inlined during the html generation, which might be the case while using the "old" browser builder instead of esbuild from what I saw

from angular.

AndrewKushnir avatar AndrewKushnir commented on August 20, 2024

Thanks for reporting this issue. I was able to reproduce it for cases when there are no events registered in an application, but Event Replay feature is enabled. I've created PR #56509 with the fix.

The problem seems to be the bundle jsaction contract script not correctly inlined during the html generation, which might be the case while using the "old" browser builder instead of esbuild from what I saw

@Fluccioni the mentioned PR would likely resolve that problem as well (there will be no JS exceptions), but we may consider adding some logic to detect those cases and add a warning. Could you please create a minimal repro (in a form of GitHub repository), so that we can perform further investigation to see if we can detect those cases?

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.