Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve 'supports-color' #1424

Closed
6 tasks done
piotrkulpinski opened this issue Sep 7, 2023 · 2 comments
Closed
6 tasks done

Module not found: Can't resolve 'supports-color' #1424

piotrkulpinski opened this issue Sep 7, 2023 · 2 comments
Labels
needs investigation This needs to be investigated further before proceeding

Comments

@piotrkulpinski
Copy link

Checklist

Description

Hi,
I'm setting up auth with this package and I've run into an issue after installing it.

The NextJS server is throwing the following warning:

- warn ./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
Module not found: Can't resolve 'supports-color' in '.../app/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src'

Import trace for requested module:
./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
./node_modules/.pnpm/@auth0+nextjs-auth0@3.1.0_next@13.4.19/node_modules/@auth0/nextjs-auth0/dist/auth0-session/utils/debug.js
./node_modules/.pnpm/@auth0+nextjs-auth0@3.1.0_next@13.4.19/node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/node-client.js
./node_modules/.pnpm/@auth0+nextjs-auth0@3.1.0_next@13.4.19/node_modules/@auth0/nextjs-auth0/dist/index.js

Reproduction

  1. Install the package with latest NextJS.
  2. Run the server
  3. Watch console

Additional context

No response

nextjs-auth0 version

3.1.0

Next.js version

13.4.19

Node.js version

16.20.0

@adamjmcgrath
Copy link
Contributor

adamjmcgrath commented Sep 7, 2023

Hi @piotrkulpinski - thanks for raising this

This looks like an open issue with debug see debug-js/debug#912 for a workaround

Edit: Actually - this look like a different issue - let me investigate

@adamjmcgrath adamjmcgrath reopened this Sep 7, 2023
@adamjmcgrath adamjmcgrath added the needs investigation This needs to be investigated further before proceeding label Sep 7, 2023
@adamjmcgrath
Copy link
Contributor

@piotrkulpinski debug attempts to require('supports-color') and fails silently if it's not available (see https://github.com/debug-js/debug/blob/master/src/node.js#L115) so this warning can be safely ignored. If you don't want this warning you can install supports-color yourself (although make sure you install 8 - not 9).

I'm reluctant to add supports-color@8 to this repo and make everyone include it in this bundle if it's not needed, so I suggest this is kept as advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This needs to be investigated further before proceeding
Projects
None yet
Development

No branches or pull requests

2 participants