#Next.js 13 app router and contentlayer version 0.3.4 error, with solution

9 messages · Page 1 of 1 (latest)

willow mortar
#

I'm running into an error when running pnpm contentlayer build in an attempt to generate output from markdown files. The error I'm getting is from node_modules and I can't understand what I need to do to fix this.

Full error (the file location is listed within node_modules):

import { ConsoleSpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
         ^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'ConsoleSpanExporter' not found. The requested module '@opentelemetry/sdk-trace-base' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@opentelemetry/sdk-trace-base';
const { ConsoleSpanExporter, SimpleSpanProcessor } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)```

Thank you for any help, I've been stuck with this error for the past hours and have gotten nowhere.

For reference, my repo can be found here (the relevant code is within the branch linked): <https://github.com/brianschnee/portfolio-sleek/tree/mdx-refactor>
burnt valleyBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

      🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>

      ✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
      (if you don't see the option, try refreshing Discord with Ctrl + R)
burnt valleyBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer

[Click here](#1126745727884865557 message)

final light
#

hmm why did you delete the message, thought you fixed it yourself

willow mortar
#

Ok, we are good lmao. I also had a problem with my contentlayer config.

#

moving from contentlayer verison 0.3.4 to 0.3.1 resolved my issue

#

This has been solved ✅

#

Next.js 13 app router and contentlayer version 0.3.4 error, with solution