Closed lunelson closed 2 years ago
Thank you for the repro! I'll try to have a look asap!
Looks like I figured it out 🤦🏻
Because I wanted access to the basePath
constant, I pulled it in from next.config.js
, but this caused that entire module to execute and fail—probably because in the remote serverless function context most of that stuff doesn't apply, though strangely it works on localhost
...so I updated both the API routes and next.config.js
to pull the basePath
value from somewhere else and it works now—I guess that's the value of doing a minimal reproduction 😅
Are you trying to transpile a local package or an npm package?
I'm trying to transpile my own npm package
@rasahq/react-tabula
Describe the bug
I'm working on a site that is configured with a
basePath
. All works correctly for bothdev
andbuild
, locally and remotely, but fails when I trigger an API path on the remote, resulting in a server error500
.I can't reproduce this error in any other environment, the
/api/preview
path works correctly when built and served on my machine. The following is the log from Vercel on my own production site (but I've made a minimal reproduction deployment below):To Reproduce
I've created a minimal reproduction here:
Expected behavior
The API routes should put the site in to preview mode, and cause the
PreviewControls
component to show at the bottom of the screen. If you clone and build this site locally you will see this. On the remote it produces a 500 server error.Try this route for example
Setup
next-transpile-modules
version: 8.0.0npm
/yarn
version: