sadmann7 / skateshop

An open source e-commerce skateshop build with everything new in Next.js.
https://skateshop.sadmn.com
MIT License
5.1k stars 731 forks source link

@opentelemetry error #40

Closed ThiagoUnder closed 1 year ago

ThiagoUnder commented 1 year ago

Cloned repo, pnpm installed and changed .env variables and on running got the error:

> next dev

- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- info Loaded env from /Users/thiagoleobons/jul/repos/skateshop/.env.local
- error Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
file:///Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@effect-ts+otel@0.15.1_@effect-ts+core@0.60.5_@opentelemetry+api@1.4.1_@opentelemetry+core@1._vak64uwhuw23bp45xj3whrz3hy/node_modules/@effect-ts/otel/_mjs/Processor/Simple/index.mjs:7
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;
sadmann7 commented 1 year ago

Did you update packages?

I once got this when i updated packages

ThiagoUnder commented 1 year ago

Just did pnpm i I saw now that there were both a package-lock and a pnpm-lock. Deleted node modules and package-lock and pnpm i again now I have

<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/dynamic-build.js for build dependencies failed at 'import(`file://${compiledConfigPath}`)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/getConfig/index.js for build dependencies failed at 'import(`file://${modulePath}?x=${Date.now()}`)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/generation/generate-dotpkg.js for build dependencies failed at 'import(filePathJoin(generatedPkgPath, 'generated', 'index.mjs'))'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Can't resolve 'markdown-wasm/dist/markdown.node.js' in '/Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/markdown'
<w> while resolving 'markdown-wasm/dist/markdown.node.js' in /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/markdown as file
<w>  at resolve esm file markdown-wasm/dist/markdown.node.js
<w>  at file dependencies /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/markdown/markdown.js
<w>  at file /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/markdown/markdown.js
<w>  at resolve esm file ./markdown/markdown.js
<w>  at file dependencies /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/index.js
<w>  at file /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/@contentlayer+core@0.3.4_esbuild@0.18.11/node_modules/@contentlayer/core/dist/index.js
<w>  at resolve esm file @contentlayer/core
<w>  at file dependencies /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/next-contentlayer@0.3.4_contentlayer@0.3.4_esbuild@0.18.11_next@13.4.8_react-dom@18.2.0_react@18.2.0/node_modules/next-contentlayer/dist/plugin.js
<w>  at file /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/next-contentlayer@0.3.4_contentlayer@0.3.4_esbuild@0.18.11_next@13.4.8_react-dom@18.2.0_react@18.2.0/node_modules/next-contentlayer/dist/plugin.js
<w>  at resolve esm file ./plugin.js
<w>  at file dependencies /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/next-contentlayer@0.3.4_contentlayer@0.3.4_esbuild@0.18.11_next@13.4.8_react-dom@18.2.0_react@18.2.0/node_modules/next-contentlayer/dist/index.js
<w>  at file /Users/thiagoleobons/jul/repos/skateshop/node_modules/.pnpm/next-contentlayer@0.3.4_contentlayer@0.3.4_esbuild@0.18.11_next@13.4.8_react-dom@18.2.0_react@18.2.0/node_modules/next-contentlayer/dist/index.js
<w>  at resolve esm file next-contentlayer
<w>  at file dependencies /Users/thiagoleobons/jul/repos/skateshop/next.config.mjs
<w>  at file /Users/thiagoleobons/jul/repos/skateshop/next.config.mjs
<w>  at resolve commonjs /Users/thiagoleobons/jul/repos/skateshop/next.config.mjs
sadmann7 commented 1 year ago

Oh someone must have pushed their package.lock.json or me.

sadmann7 commented 1 year ago

This is a contentlayer error on the latest version.

https://github.com/contentlayerdev/contentlayer/issues/506

Don't update contelayer and next-contentlayer until fixed

ThiagoUnder commented 1 year ago

This is a contentlayer error on the latest version.

contentlayerdev/contentlayer#506

Don't update contelayer and next-contentlayer until fixed

I made a comment there. The solution on the thread still throws an error for me when I run the dev server