Skip to content

Commit

Permalink
dummy import of openid-client to get nextjs to leave it in node_modul…
Browse files Browse the repository at this point in the history
…es (#3438)

* dummy import of openid-client to get nextjs to leave it in node_modules

* added missing file
  • Loading branch information
deepakprabhakara authored Dec 16, 2024
1 parent 4d7265b commit 6e4e252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ COPY --from=builder /app/public ./public
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Fix for dynamic import of openid-client
RUN npm i --no-package-lock --no-save --omit=dev openid-client@$(npm --prefix npm pkg get dependencies.openid-client | xargs)

# Support for DB migration
COPY --from=builder --chown=nextjs:nodejs /app/migrate.sh ./migrate.sh
Expand Down
8 changes: 8 additions & 0 deletions pages/api/openid-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Leave the openid-client import to get nextjs to leave the library in node_modules after build
import * as dummy from 'openid-client';
import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req: NextApiRequest, res: NextApiResponse<any>) {
const unused = dummy; // eslint-disable-line @typescript-eslint/no-unused-vars
res.status(200).json({});
}

0 comments on commit 6e4e252

Please sign in to comment.