nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
501 stars 114 forks source link

TypeScript Compilation Error in module.d.ts #662

Closed noda13 closed 5 months ago

noda13 commented 5 months ago

Version

@nuxtjs/sentry: 8.0.6 nuxt: 2.15.7

Sentry configuration

Reproduction Link

Steps to reproduce

  1. Install the @nuxtjs/sentry package.
  2. Run the TypeScript compiler with the --noEmit option.

What is Expected?

The TypeScript compiler should complete without errors.

What is actually happening?

The TypeScript compiler is throwing an error related to the module.d.ts file in the @nuxtjs/sentry package. The error message is as follows:

node_modules/@nuxtjs/sentry/dist/module.d.ts:123:15 - error TS1005: ',' expected.

123 export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default };
                  ~~~~~~~~~~~~~

node_modules/@nuxtjs/sentry/dist/module.d.ts:123:35 - error TS1005: ',' expected.

123 export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default };
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~

It seems like there is a syntax error in the export statement. Specifically, the type keyword seems to be causing the issue. If I remove the type keyword, the error does not occur. The corrected line would look like this:

export { ModuleOptions, ModulePublicRuntimeConfig, _default as default };
rchl commented 5 months ago

It means that the typescript version you are using is pretty old. I'm not sure when was this syntax introduced exactly but I would not consider it something that needs be addressed.

noda13 commented 5 months ago

Thank you for your quick response. I understand now that the issue is due to the version of TypeScript I'm using being outdated. I'll look into updating it. I appreciate your help!