opennextjs / opennextjs-aws

Open-source Next.js adapter for AWS
https://opennext.js.org
MIT License
4.14k stars 126 forks source link

@opentelemetry/api does not seem to work with Next.js 15 #587

Closed ruchernchong closed 3 weeks ago

ruchernchong commented 3 weeks ago

Error:

Could not resolve "@opentelemetry/api"

    node_modules/.pnpm/next@15.0.0_@babel+core@7.25.8_react-dom@19.0.0-rc-69d4b800-20241021_react@19.0.0-rc-69d4b800_uh4t4uztsorvxmrfdwbfot353m/node_modules/next/dist/server/lib/trace/tracer.js:46:18:
      46 │     api = require('@opentelemetry/api');
         ╵                   ~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@opentelemetry/api" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

Here is the reference for the error mentioned.


Of course, I can temporary fix it by using the suggested solution, but would be nice if this will also be gracefully fixed by the next release.

conico974 commented 3 weeks ago

This has been fixed in 3.1.3, upgrade to at least this version. If that's still an issue just reopen the issue

ruchernchong commented 3 weeks ago

This has been fixed in 3.1.3, upgrade to at least this version. If that's still an issue just reopen the issue

Thank you for the prompt reply! I confirm that the error is now fixed for me!