Next.js Discord

Discord Forum

How to mark dependency as external? (Module not found!)

Answered
Burmese posted this in #help-forum
Open in Discord
BurmeseOP
I have an app that uses auth0. It has an optional peer dependency of superagent-proxy.

I don't use the feature that requires superagent-proxy.

The build fails because superagent-proxy is not found.

How can I inform NextJS that this dependency is external, or somehow ignore this missing dependency?
Answered by Burmese
Based on everything I know, I believe modifying the webpack config is my only option here:
  webpack: config => {
    // eslint-disable-next-line no-param-reassign
    config.resolve.alias['superagent-proxy'] = false
    return config
  }
View full answer

1 Reply

BurmeseOP
Based on everything I know, I believe modifying the webpack config is my only option here:
  webpack: config => {
    // eslint-disable-next-line no-param-reassign
    config.resolve.alias['superagent-proxy'] = false
    return config
  }
Answer