You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my CTO worked on configuring OTEL on our project codebase and its fulling working on his maching, I pulled his changes on my windows system and installed packages and ran the codebase on my system and ran into this error I dont know how to solve it
`[ info ] watching file system for changes...
file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:26
throw new E_OTEL_CONFIG([path], { cause: error });
^
Exception: Failed to load OpenTelemetry config at "C:\Users\danig\Projects\togetha-v2\config\otel.js". Make sure the file exists and has no syntax errors.
at file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:26:15
at async loadConfig (file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:23:12)
at async init (file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:40:20)
at async (C:\Users\danig\Projects\togetha-v2\otel.ts:9:1) {
status: 500,
code: 'E_OTEL_CONFIG',
[cause]: Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:209:11)
at defaultLoad (node:internal/modules/esm/load:107:3)
at nextLoad (node:internal/modules/esm/hooks:748:28)
at C:\Users\danig\Projects\togetha-v2\node_modules\ts-node-maintained\src\esm.ts:255:45
at async addShortCircuitFlag (C:\Users\danig\Projects\togetha-v2\node_modules\ts-node-maintained\src\esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/hooks:748:22)
at async nextLoad (node:internal/modules/esm/hooks:748:22)
at async Hooks.load (node:internal/modules/esm/hooks:385:20)
at async MessagePort.handleMessage (node:internal/modules/esm/worker:199:18) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
}`
and the configuration file looks normal this is the config/otel.ts
`import { defineConfig, OTLPTraceExporter } from '@adonisjs/otel'
import env from '#start/env'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
my CTO worked on configuring OTEL on our project codebase and its fulling working on his maching, I pulled his changes on my windows system and installed packages and ran the codebase on my system and ran into this error I dont know how to solve it
`[ info ] watching file system for changes...
file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:26
throw new E_OTEL_CONFIG([path], { cause: error });
^
Exception: Failed to load OpenTelemetry config at "C:\Users\danig\Projects\togetha-v2\config\otel.js". Make sure the file exists and has no syntax errors.
at file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:26:15
at async loadConfig (file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:23:12)
at async init (file:///C:/Users/danig/Projects/togetha-v2/node_modules/@adonisjs/otel/build/src/start.js:40:20)
at async (C:\Users\danig\Projects\togetha-v2\otel.ts:9:1) {
status: 500,
code: 'E_OTEL_CONFIG',
[cause]: Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:209:11)
at defaultLoad (node:internal/modules/esm/load:107:3)
at nextLoad (node:internal/modules/esm/hooks:748:28)
at C:\Users\danig\Projects\togetha-v2\node_modules\ts-node-maintained\src\esm.ts:255:45
at async addShortCircuitFlag (C:\Users\danig\Projects\togetha-v2\node_modules\ts-node-maintained\src\esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/hooks:748:22)
at async nextLoad (node:internal/modules/esm/hooks:748:22)
at async Hooks.load (node:internal/modules/esm/hooks:385:20)
at async MessagePort.handleMessage (node:internal/modules/esm/worker:199:18) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
}`
and the configuration file looks normal this is the config/otel.ts
`import { defineConfig, OTLPTraceExporter } from '@adonisjs/otel'
import env from '#start/env'
export default defineConfig({
serviceName: env.get('APP_NAME'),
serviceVersion: env.get('APP_VERSION'),
environment: env.get('NODE_ENV'),
samplingRatio: 0.5,
traceExporter: new OTLPTraceExporter({
url: 'https://eu.i.posthog.com/i/v1/logs',
headers: { Authorization:
Bearer ${env.get('POSTHOG_API_KEY')}},}),
})
`
Beta Was this translation helpful? Give feedback.
All reactions