#Docker with Sentry & NextJS

3 messages · Page 1 of 1 (latest)

median crow
#

Has anyone had any experience setting up docker with NextJS alongside Sentry.io ?

Currently I am getting this error;

client  | 
client  | > [email protected] dev
client  | > next dev
client  | 
client  | node:internal/modules/cjs/loader:1149
client  |   const err = new Error(message);
client  |               ^
client  | 
client  | Error: Cannot find module '@sentry/nextjs'
client  | Require stack:
client  | - /app/next.config.js
client  |     at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
client  |     at /app/node_modules/next/dist/server/require-hook.js:54:36
client  |     at Module._load (node:internal/modules/cjs/loader:990:27)
client  |     at Module.require (node:internal/modules/cjs/loader:1237:19)
client  |     at mod.require (/app/node_modules/next/dist/server/require-hook.js:64:28)
client  |     at require (node:internal/modules/helpers:176:18)
client  |     at Object.<anonymous> (/app/next.config.js:3:30)
client  |     at Module._compile (node:internal/modules/cjs/loader:1378:14)
client  |     at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
client  |     at Module.load (node:internal/modules/cjs/loader:1212:32) {
client  |   code: 'MODULE_NOT_FOUND',
client  |   requireStack: [ '/app/next.config.js' ]
client  | }
client  | 
client  | Node.js v21.6.1

My next.config.js file is attached as an image alongside my docker file and other pieces of information that I believe related. If there is any further info I can provide pleased let me know and I'd be happy to do so.

dawn nebulaBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

high jetty
#

Just curious why are you having to install @sentry/nextjs separatley vs including the package in the package.json that's copied into your /app NextJS directory? That way when you run the step RUN npm ci the sentry package gets installed there as well?

I'm assumming it might be a scoping issue with the sentry package being npm install'd in a wrong location. Just my 2c