Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not building when when using yarn... #106

Open
patmancodes opened this issue Jul 15, 2024 · 2 comments
Open

Not building when when using yarn... #106

patmancodes opened this issue Jul 15, 2024 · 2 comments

Comments

@patmancodes
Copy link

Is it possible to use this package with a self hosted instance of a nextjs 14.2 'pages' directory app? (we've e custom collector used by other Backend apps within our org)

I've followed the instructions outlined here -https://vercel.com/docs/observability/otel-overview but hitting some dependency/build issues.

I've added the @vercel/otel package using yarn ,
added instrument.ts ,
set the i_nstrumentationHook_ flag in next config.

First issue -
Failed to compile with the following error

./node_modules/@vercel/otel/dist/edge/index.js:4362:1
Module not found: Can't resolve '@opentelemetry/api-logs'

So I tried adding that missing package manually to just try getting it working

Second issue
I'm now getting this build issue which is very strange. The imported types are navigable in vscode..

./instrumentation.ts
Attempted import error: 'registerOTel' is not exported from '@vercel/otel' (imported as 'registerOTel').

Any help appreciated!

@patmancodes patmancodes changed the title Build issues after adding @vercel/otel package Not building when when using yarn... Jul 16, 2024
@patmancodes
Copy link
Author

I obviously missed that yarn doesn't 'auto add' peer dependencies, this has to be done manually..

@RichardsonBrandon
Copy link

Similar issue except my error is

error - ../../node_modules/@vercel/otel/dist/edge/index.js:4:43681
Module not found: Can't resolve 'async_hooks'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./instrumentation.ts
TypeError: An error occurred while loading instrumentation hook: require(...).register is not a function

Next version: 13.2
Node version: 18.20.4
vercel/otel: 1.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants