[Next.js] Internal error during "Functions bundling" on Build

While I’m not sure about the library,

this would mean that you’re trying to load a file from the file-system (not a module) dynamically. It might be in an if/else block or something else. You should try to require the files regardless or whether they would be used or not. You can try something like: