Skip to content

Module Not Found #259

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

Closed
slavakurilyak opened this issue Jun 29, 2022 · 1 comment
Closed

Module Not Found #259

slavakurilyak opened this issue Jun 29, 2022 · 1 comment

Comments

@slavakurilyak
Copy link

Running $ next build gives the following:

warn  - Detected next.config.js, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration
info  - Checking validity of types  
info  - Creating an optimized production build  
Failed to compile.

./pages/blog.tsx
Module not found: Package path ./generated is not exported from package /Users/skurilyak/dev/slavakurilyak/slavakurilyak.com/node_modules/contentlayer (see exports field in /Users/skurilyak/dev/slavakurilyak/slavakurilyak.com/node_modules/contentlayer/package.json)

./pages/blog/[slug].tsx
Module not found: Package path ./generated is not exported from package /Users/skurilyak/dev/slavakurilyak/slavakurilyak.com/node_modules/contentlayer (see exports field in /Users/skurilyak/dev/slavakurilyak/slavakurilyak.com/node_modules/contentlayer/package.json)


> Build failed because of webpack errors
@slavakurilyak
Copy link
Author

Fixed the issue by changing the next.config.js file to:

const { withContentlayer } = require('next-contentlayer');

module.exports = withContentlayer({
  images: {
    domains: ['pexels.com'],
  },
});

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

No branches or pull requests

1 participant