Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Error: Cannot set property 'prebootData' of undefined #92

Closed
2 of 8 tasks
amit-kumar27 opened this issue Sep 22, 2018 · 2 comments
Closed
2 of 8 tasks

Error: Cannot set property 'prebootData' of undefined #92

amit-kumar27 opened this issue Sep 22, 2018 · 2 comments

Comments

@amit-kumar27
Copy link

Note: for support questions, please use the Universal Slack Channcel or https://gitter.im/angular/universal

  • I'm submitting a ...
  • bug report
  • feature request
  • Which parts of preboot are affected by this issue?
  • server side
  • client side
  • inline
  • build process
  • docs
  • tests
  • What is the current behavior?
    After adding preboot@6.0.0-beta.3, in my Angular@5.2.1 application, getting this error on SSR,
    'Uncaught TypeError: Cannot set property 'prebootData' of undefined'

screen shot 2018-09-22 at 3 06 02 pm

screen shot 2018-09-22 at 3 06 39 pm

screen shot 2018-09-22 at 3 07 15 pm

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by creating a github repo.

I have added PrebootModule in my root.module.ts like this:-

import { BrowserModule } from "@angular/platform-browser";
import { PrebootModule } from 'preboot';
import { ServerTransition } from "./server-transition.module";
import { RootComponent } from "./root.component";
...

@NgModule({
  imports: [
    ...,
    BrowserModule.withServerTransition({ appId: 'ng-web-app' }),
    PrebootModule.withConfig({ appRoot: 'root'}),    // 'root' is the selector of root component
    ...

  ],
  declarations: [
    RootComponent,
    ...
  ]
})
export class RootModule {}

and my root.server.module.ts :-

import {NgModule} from '@angular/core';
import { ServerModule } from '@angular/platform-server';
import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader';
import { RouterModule } from '@angular/router';

import {RootModule} from '../client/root.module';
import {Root} from '../client/root.component';

@NgModule({
  imports: [
    RootModule,
    ServerModule,
    ModuleMapLoaderModule
  ],
  bootstrap: [Root],
  providers: []
})
export class RootServerModule {}

  • What is the expected behavior?
    This error should not occur and the transition between SSR and CSR should be smooth.

  • Please tell us about your environment:

  • Language: [TypeScript ]
  • Platform: [ NodeJs | Angular-5.2.1 ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
@CaerusKaru
Copy link
Member

We do not support or have LTS for any other version other than the current beta and the version of Angular it supports (in this case 6.0.0-beta.6 and Angular v6). I apologize for the inconvenience this may cause, but this is a very small project. If you can reproduce the issue on the latest beta, this is definitely something we can look into.

@CaerusKaru
Copy link
Member

Closing. We can open if a reproduction with latest beta is added.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants