-
Notifications
You must be signed in to change notification settings - Fork 821
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
NodeSDK fails in strict mode with Legacy octal escape is not permitted in strict mode
#3759
Comments
cc @dyladan |
The log makes it clear what causes the issue. The import order of packages is:
I don't know where we can break this chain.
|
I couldn't reproduce the issue with the But it still would be useful to use up-to-date and maintained dependencies ( |
@jankaifer are you using the For users of |
No, we expect our users will use mostly OTLP. Feel free to re-open the issue if you want to track this issue with |
Hey @pichlermarc I'm also receiving this error with Next.js, see vercel/otel#8 I'm not using jaeger in my app code and AFAIA the @vercel/otel wrapper doesn't use this either. However even when ensuring I'm using v0.39 of the OTEL Node SDK I still get this error. Any ideas? I've also tried removing the Vercel wrapper and configuring OTEL directly, the code for that is below but I get the same issue. import { trace, context } from '@opentelemetry/api';
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-node';
const sdk = new NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'next-app',
}),
spanProcessor: new SimpleSpanProcessor(new OTLPTraceExporter()),
});
sdk.start();
export const tracer = trace.getTracer('next-app-tracer');
export { context }; |
@jankaifer How did you solve this in the app directory? Or could you only get it to work in the page directoy? |
@tom-sherman you're right, looks like this was not fixed by |
To fix this we'll have to either
|
How's progress on this? I have the same error on a Next.js app using Is there a way to work around this? I can also lend a hand to work on the fix. I'm available at #otel-js in Slack. |
Was blocked by this for a few weeks, eventually just bit the bullet and fixed it myself. Forked ansi-color library and updated the octal escapes.
Then set the following in package.json to override the reference.
This solution requires that you have SSH for github cli setup so that NPM can access it if you have protected repositories. |
@Quickgs - does this work in Next middleware on vercel? I tried doing basically exactly this and then I got a lot of upset that the node performance APIs were being called. |
I am unsure, I am invoking it within the instrumentation.ts special file in next13 hosted on an AWS pod and sending it to a Honeycomb collector. |
@maggiepint I don't think instrumentation is available in the Edge runtime, it's cloudflare workers based which doesn't allow eg. Accurate timings. |
This is still happening to me with (Update: should be fixed with #4214) |
Fix for `Legacy octal escape is not permitted in strict mode` Reference : open-telemetry/opentelemetry-js#3759 (comment)
What happened?
Steps to Reproduce
Import
NodeSDK
in strict mode.Expected Result
It should not fail.
Actual Result
When I run
pnpm build
, it fails. Logs below.Additional Details
Reproduction: https://github.com/jankaifer/next-repro-otel-node-sdk-repro
OpenTelemetry Setup Code
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: