import '@nuxtjs/sentry' causes failure to compile

brokenthorn
0
brokenthorn
commented a year ago

Version

v4.0.1

Reproduction link

https://codesandbox.io/s/aged-frog-vsgpy?file=/pages/index.vue

Steps to reproduce

  1. Creat an empty NuxtJS project using the latest version.
  2. Add @nuxtjs/sentry to dependencies.
  3. Add @nuxtjs/sentry to nuxt.config.js modules section.
  4. $sentry is not available on the Nuxt context automatically so try to import definitions by adding import '@nuxtjs/sentry' to a Nuxt page/component.
  5. With line added at 4., build fails. Without it it works but build warns about undefined $sentry (just a type check, the object is in fact there).

What is expected ?

Successful build.

What is actually happening?

× Client
Compiled with some errors in 4.93s

√ Server
Compiled successfully in 2.97s

i Type checking in progress… nuxt:typescript 05:55:31

ERROR Failed to compile with 7 errors friendly-errors 05:55:31

These dependencies were not found: friendly-errors 05:55:31
friendly-errors 05:55:31

  • childprocess in ./nodemodules/@sentry/cli/js/helper.js friendly-errors 05:55:31
  • console in ./node_modules/@sentry/node/esm/integrations/console.js friendly-errors 05:55:31
  • fs in ./nodemodules/@sentry/node/esm/parsers.js, ./nodemodules/@sentry/node/esm/integrations/modules.js and 1 other friendly-errors 05:55:31
  • net in ./node_modules/https-proxy-agent/index.js friendly-errors 05:55:31
  • tls in ./nodemodules/https-proxy-agent/index.js friendly-errors 05:55:31 friendly-errors 05:55:31 To install them, you can run: npm install --save childprocess console fs net tls friendly-errors 05:55:31
    i Waiting for file changes 05:55:31
    {"level":30,"time":1587351331741,"pid":16248,"hostname":"baby","msg":"Server listening at http://0.0.0.0:3001","v":1}

Additional comments?

Developing on Windows 10.

bug
0
Informations
Bug ReportOpen
#c93 - Created a year ago