Quick start not working with a Next.js project

I've submitted an issue for this on Github, but I'm wondering if anyone else is running into this, or if there is some step I'm missing for using SM with Next.

With a brand new project I run through the quick start for Next.js, use the most recent prismic-cli (3.8.3-beta.0), and create exactly the component used in the video in the quick start guide, in a brand new repo, and an exception is thrown when I try to load the content for that one slice.
ReferenceError: h is not defined

This seems to be thrown in the render function for the built in slice library.

Everything works fine for me using Nuxt. Has anyone else seen this and figured out how to fix it?

Hey @jware,

Thanks for posting this question.

First of all, can you check your package.json and see if these dependencies are up to date?

    "essential-slices": "^1.0.2",
    "theme-ui": "^0.3.4",

I'm not sure why, but I've seen other Next.js starters that wind up with old versions of these plugins.

If that's not the issue, could you share your project files with my in a .zip file or a GitHub repo? I'll be happy to take a look and try to debug. You can send them via DM if you don't want to share them publicly.


Yes those are up to date. That was one of the first things I checked as I saw that issue that someone else ran into. It's happening to others who do the quick start right now as well it seems. I think there was some change in a dependency of essential-slices that breaks them now

I'm getting the same error:

ReferenceError: h is not defined X

Any suggestion?

Hey @jware and @cesar.leon,

I just saw that Hugo replied on the GitHub issue. You can try changing essential-slices to 1.0.3-alpha.0. That worked for me. Let me know if it works for you.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.