Adding this to my next.config.js worked to fix this issue for my project
serverExternalPackages: ['odbc', '@mapbox/node-pre-gyp'],