Coder Social home page Coder Social logo

Comments (2)

bastienallain avatar bastienallain commented on June 11, 2024

`
successCallback /Users/Osx/github/.contentlayer
Local search index generated...
Generated 4 documents in .contentlayer

File updated: blog/test.mdx
✘ [ERROR] Could not resolve "path"

node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/compiled/micromatch/index.js:22:3444:
  22 │ ...=toRegexRange},17:e=>{e.exports=require("path")},837:e=>{e.exports=require("util")}};...
     ╵                                            ~~~~~~

The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "util"

node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/compiled/micromatch/index.js:22:3479:
  22 │ ...uire("path")},837:e=>{e.exports=require("util")}};var t={};function __nccwpck_require...
     ╵                                            ~~~~~~

The package "util" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Cannot import "node_modules/.pnpm/[email protected]/node_modules/swiper/swiper.css" into a JavaScript file without an output path configured

components/Slideshow/SlideShow.tsx:3:7:
  3 │ import 'swiper/css'
    ╵        ~~~~~~~~~~~~

✘ [ERROR] Cannot import "node_modules/.pnpm/[email protected]/node_modules/swiper/modules/navigation.css" into a JavaScript file without an output path configured

components/Slideshow/SlideShow.tsx:4:7:
  4 │ import 'swiper/css/navigation'
    ╵        ~~~~~~~~~~~~~~~~~~~~~~~

Error: Found 1 problems in 1 documents.

└── Encountered unexpected errors while processing of 1 documents. This is possibly a bug in Contentlayer. Please open an issue.

 • "blog/test.mdx": UnexpectedMDXError: Error: Build failed with 4 errors:
 components/Slideshow/SlideShow.tsx:3:7: ERROR: Cannot import "node_modules/.pnpm/[email protected]/node_modules/swiper/swiper.css" into a JavaScript file without an output path configured
 components/Slideshow/SlideShow.tsx:4:7: ERROR: Cannot import "node_modules/.pnpm/[email protected]/node_modules/swiper/modules/navigation.css" into a JavaScript file without an output path configured
 node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/compiled/micromatch/index.js:22:3444: ERROR: Could not resolve "path"
 node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/compiled/micromatch/index.js:22:3479: ERROR: Could not resolve "util"

successCallback /Users/Osx/github/.contentlayer
Local search index generated...
SourceFetchDataError: {
"_tag": "HandledFetchDataError"`

from tailwind-nextjs-starter-blog.

timlrx avatar timlrx commented on June 11, 2024

Try using this approach instead: https://github.com/timlrx/tailwind-nextjs-starter-blog/blob/main/faq/custom-mdx-component.md

Because of the two different build steps between contentlayer / markdown and the final website, only simple react component work if you are trying to import it directly.

from tailwind-nextjs-starter-blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.