instead of patching the tracer.js file to throw on @opentelemetry/api imports, delete the @opentelemetry/api dependency itself#259
Conversation
🦋 Changeset detectedLatest commit: 13a5f89 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
…api` imports, delete the `@opentelemetry/api` dependency itself
0257c06 to
13a5f89
Compare
|
In the apps I've tested my solution worked just fine (the one mentioned in the issue and my nodejs.org fork) But in the create-next-app example is instead erroring 😓 (The apps were using Anyways the issue is this code, usually the problematic require gets tree shaken away: That doesn't seem to happen in the create-next-app's case though 😓 I think this is extra problematic because as you can see, the file is inside the |
|
Given my comment above I am a bit of at a loss... if the tracer is outside of our output directory ( It feels like for the time being (until we properly solve #14) we have to ask people to use wrangler aliases to make Unless someone has some idea? @vicb, @petebacondarwin, @james-elicx? 😖 |
|
Not looked at it deeply but I was also wondering about
Maybe with pnpm you will delete a link, resulting in the dep being deleted in the root |
Nono the dep is not resolved, I'm sure of it, I've debugged it multiple times and also that would break the applications (since the non-precompiled dep errors in workerd). I do think that the dep deleting is correct, at least, if everything the worker needs (including |
|
Got any workaround for this? |


the problem that this addresses is that the
@opentelemetry/apipackage is not only imported by thetracer.jsfilewe patch, so just deleting the library itself makes sure that all files requiring it get the same throwing behavior
(besides decreasing the overall worker size)