staylor / react-helmet-async

Thread-safe Helmet for React 16+ and friends
Apache License 2.0
2.09k stars 154 forks source link

Uncaught TypeError: Object prototype may only be an Object or null: undefined #49

Closed egges closed 5 years ago

egges commented 5 years ago

I am using Parcel as a bundler and when I update to the latest version of react-helmet-async (1.0.1), I get an error on loading the page "Uncaught TypeError: Object prototype may only be an Object or null: undefined", in node_modules/react-helmet-async/lib/index.mjs.react-fast-compare (Provider.js:20). The Chrome debugger gives me this error on the last line of this piece of code in Provider.js (setting the titleAttributes property):

props.context.helmet = mapStateOnServer({
        baseTag: [],
        bodyAttributes: {},
        encodeSpecialCharacters: true,
        htmlAttributes: {},
        linkTags: [],
        metaTags: [],
        noscriptTags: [],
        scriptTags: [],
        styleTags: [],
        title: '',
        titleAttributes: {},
      });

Does anybody have an idea what this could be?

staylor commented 5 years ago

@egges did you change import Helmet from to import { Helmet } from?

egges commented 5 years ago

@staylor Thanks for replying so quickly. I did change all imports to named imports. However, updating to v1.0.2 seems to have fixed my problem, so you may close this issue.