Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError 'map' of null #27

Closed
markgoho opened this issue Mar 11, 2017 · 2 comments · Fixed by #30
Closed

TypeError 'map' of null #27

markgoho opened this issue Mar 11, 2017 · 2 comments · Fixed by #30

Comments

@markgoho
Copy link

markgoho commented Mar 11, 2017

Getting this in the console on first page load:

Error: Uncaught (in promise): TypeError: Cannot read property 'map' of null
TypeError: Cannot read property 'map' of null
at new ConfigService (http://localhost:4200/vendor.bundle.js:26138:30)
at wpConfigFactory (http://localhost:4200/vendor.bundle.js:96289:12)

I'm initializing the module exactly how the docs state:
WordPressModule.forRoot('https://www.gideonlabs.com/', null, true),

@markgoho markgoho changed the title Type Error map of null TypeError 'map' of null Mar 11, 2017
@markgoho
Copy link
Author

WordPressModule.forRoot('https://www.gideonlabs.com/'),

This gives the same TypeError message, so it must not be due to how I'm initializing the Module.

@markgoho
Copy link
Author

markgoho commented Mar 11, 2017

Using photonOptions() as instructed in the docs removes the error:

export function photonOptions() {
  return [
    { 'key': 'large', 'value': { w: 800, h: 360 } },
    { 'key': 'cropped', 'value': { crop: "160px,25,1400px,60" } },
    { 'key': 'resized', 'value': { resize: "400,220" } }
  ]
}

WordPressModule.forRoot('https://www.gideonlabs.com/', photonOptions(), true),

No error when doing it this way.

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

Successfully merging a pull request may close this issue.

2 participants