Next.js 13 app router and contentlayer version 0.3.4 error, with solution
Answered
Rhinelander posted this in #help-forum
RhinelanderOP
I'm running into an error when running
Full error (the file location is listed within node_modules):
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
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
Answered by Rhinelander
moving from
contentlayer verison 0.3.4 to 0.3.1 resolved my issue5 Replies
hmm why did you delete the message, thought you fixed it yourself
@joulev hmm why did you delete the message, thought you fixed it yourself
RhinelanderOP
I thought I did as well, but it turns out I didn't. I was hyped before I should have been. I'm still running into the problem
RhinelanderOP
Ok, we are good lmao. I also had a problem with my contentlayer config.
RhinelanderOP
moving from
contentlayer verison 0.3.4 to 0.3.1 resolved my issueAnswer
RhinelanderOP
This has been solved ✅