Loolii
Loolii

Reputation: 455

Next.js build error: Export encountered errors on following paths

This error appears when I build.

info  - Generating static pages (15/15)

> Build error occurred
Error: Export encountered errors on following paths:
        /routine/RoutineLists
    at /home/corepen/Desktop/Project 1/rouDDine-client/node_modules/next/dist/export/index.js:31:1106
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

This isn't the right solution, but I erased 'RoutineLIsts.js' file. And I don't think this is the right solution. Even there was still another error.

How can I fix this error? Here's next.config.js file's contents.

module.exports = {
  reactStrictMode: true,
  images: {
    domains: [
      'https://png.pngtree.com/png-vector/20191004/ourlarge/pngtree-person-icon-png-image_1788612.jpg',
    ],
  },
};

const withImages = require('next-images');
module.exports = withImages();

const withVideos = require('next-videos')
module.exports = withVideos()

How should we deal with this?

This is the overall folder structure.


I found onething, when i assigned a static value and it was built, but I never wanted it.

const routine1 = {id :1, name : '123'}

  return (
    <>
    <Link href={`/routine/${routine1.id}`}>
     <a>
       <RoutineContainer
        id={routine1.id}
        onClick={(e) => {getMyRoutine(e)}}
        >
        <img id={routine1.id} src={`${process.env.NEXT_PUBLIC_url}/${img}`}></img>
          <RoutineItem id={routine1.id}>
            <RoutineTitle id={routine1.id}>{routine1.name}</RoutineTitle>
          </RoutineItem>
        </RoutineContainer>
      </a>
    </Link>
    <DeleteButton id={routine1.id} onClick={() => deleteHandler(routine1.id)}>-</DeleteButton>
    </>
  );

Upvotes: 0

Views: 9591

Answers (1)

Seyed Kazem Mousavi
Seyed Kazem Mousavi

Reputation: 457

for this code, you should use baseurl to show Image

module.exports = {
  reactStrictMode: true,
  images: {
    domains: [
      'https://png.pngtree.com',
    ],
  },
};

Upvotes: 1

Related Questions