# NextJS start project guide doesn't work

**URL:** <https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [March 18, 2022, 12:59pm UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406 "2022-03-18T12:59:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hi15](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@hi15](https://community.prismic.io/u/hi15)\
**Post date:** [March 18, 2022, 12:59pm UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406/1 "2022-03-18T12:59:41Z")

</div>

Hi,

This is the first time me trying Prismic and I'm looking at trying it out for a future project. Following the guide when creating a new Next.JS project

```auto
npx create-next-app dan-hayes
cd dan-hayes

```

Then

```auto
npx @slicemachine/init --repository dan-hayes
npm run slicemachine

```

Is giving me the error:

```auto
C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js:8
const ora_1 = __importDefault(require("ora"));
                              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\ora\index.js from C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js not supported.
Instead change the require of index.js in C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js:8:31)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\index.js:34:14)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\filesystem\manifest.js:4:17)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\filesystem\index.js:13:14)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\index.js:26:35)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\slice-machine-ui\build\scripts\start\index.js:7:16)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\slice-machine-ui\bin\start.js:3:1) {
  code: 'ERR_REQUIRE_ESM'
}

```

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/b/bf1dfa2a527d83a282684d69ac18c8ad32de915c.png)

**NPM Version:**  
v8.5.5

**Node Version:**  
v16.14.2

**Package.json:**

```auto
{
  "name": "project-name",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "slicemachine": "start-slicemachine"
  },
  "dependencies": {
    "@prismicio/client": "^6.4.1",
    "@prismicio/helpers": "^2.2.1",
    "@prismicio/react": "^2.1.2",
    "@prismicio/slice-simulator-react": "^0.2.0",
    "next": "12.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "eslint": "8.11.0",
    "eslint-config-next": "12.1.0",
    "slice-machine-ui": "^0.3.3"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [March 22, 2022, 9:31am UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406/3 "2022-03-22T09:31:23Z")

</div>

Hi @hi15,

Welcome to the Prismic community,

It seems that in some places in your code you are using es 6 import where the SM modules use require, can you try to switch in require for your modules

Looking forward to your reply,  
Fares

---

<div class="post-metadata">

**Author:** ![hi15](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@hi15](https://community.prismic.io/u/hi15)\
**Post date:** [March 22, 2022, 1:07pm UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406/4 "2022-03-22T13:07:14Z")

</div>

Hi @Fares

I feel like people are not understanding what I'm talking about here.

1. This is a blank new project. An empty folder.
2. I create a "Next.JS Project" on Prismic.
3. It gives a guide on the right hand side on how to start a project.
4. I run the required commands:

```auto
npx create-next-app dan-hayes
cd dan-hayes

```

and

```auto
npx @slicemachine/init --repository dan-hayes
npm run slicemachine

```

1. It returns the error

```auto
C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js:8
const ora_1 = __importDefault(require("ora"));
                              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\ora\index.js from C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js not supported.
Instead change the require of index.js in C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\cliLogs.js:8:31)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\utils\index.js:34:14)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\filesystem\manifest.js:4:17)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\src\filesystem\index.js:13:14)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\@slicemachine\core\build\index.js:26:35)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\slice-machine-ui\build\scripts\start\index.js:7:16)
    at Object.<anonymous> (C:\Users\toms\Documents\Projects\GitHub\dan-hayes\node_modules\slice-machine-ui\bin\start.js:3:1) {
  code: 'ERR_REQUIRE_ESM'
}

```

If you have a look at where the error is coming from it's `@slicemachine\core\build\src\utils\cliLogs.js:8 const ora_1 = __importDefault(require("ora"));`.

This is an error coming from Slice Machine. This isn't some place in my code, because there is no "my code". I haven't been able to get to that point.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [March 24, 2022, 9:00pm UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406/5 "2022-03-24T21:00:17Z")

</div>

Thanks, @hi15 for the clarification I will investigate and try to reproduce and will get back to you.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [April 6, 2022, 4:02pm UTC](https://community.prismic.io/t/nextjs-start-project-guide-doesnt-work/9406/6 "2022-04-06T16:02:13Z")

</div>

Hi @hi15,

I have tried to reproduce the issue, and it is working fine for me, and the` cliLogs.js` file doesn't exists in my latest version of @slicemachine:

 ![Screenshot 2022-04-06 at 17.58.24](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/7/7609c28fe036c77e98815c70713674b832e6e26d.png)

Can you try to restart again with a brand new project to see if the issue still happens?

Note that I haven't tested on windows, and if the problem persists, I will try to do that.
