Eslint Error: Unable to resolve path to module 'next-contentlayer'
See original GitHub issueHi. I can’t import anything from ‘next-contentlayer’:
const { withContentlayer } = require('next-contentlayer');
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
ReferenceError: withContentLayer is not defined
The same for:
import { useMDXComponent } from 'next-contentlayer/hooks';
Eslint shows:
Unable to resolve path to module 'next-contentlayer/hooks'
Package.json:
"contentlayer": "0.0.32",
"next-contentlayer": "0.0.32",
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just a tip for everyone who has the same issue. You can create a ignore rule in your
.eslintrc.json
to fix this issue for the entire project:@juanpmd I think your issue is with react 18. Downgrading to 17 will fix it @schickling I’m sorry, I’m drowning in work. Yes, I’m still having this issue. I see you’re running the dev server. Can you try building it?