-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
support environments without support for createRequire() & JSON modules #300
Comments
I don't think I'm not very familiar with Vercel, but AFAIK this happens because it tries to bundle your possibly related: vercel/ncc#578 |
What do you think about documenting this issue as known at least, e.g. in |
I exported base.json data as a javascript object file in a fork of this package. This allowed the file (now |
When switching to ECMAScript Modules (ESM) in todo, my assumption was that the Import Attributes Proposal, which would formalise JSON But by now I assume it will still take a while until we can use import attributes, so I'm fine with building a workaround.
You're welcome to submit a PR that modifies the |
Hi there,
I just tried to deploy a Next.js app with React server components using hafas-client to Vercel.
It always worked as intended on my machine, but never when deployed to a lambda function as I always got a "could not import base.json" error.
I even went as far as forking the package and replacing the require statement with an import, but that resulted in a lambda timeout.
The solution was to use node 16 instead of node 18 in the Vercel config. I also changed the region from Washington D.C. to Frankfurt, but that probably won't make any difference.
I hope this info helped anyone, but it took me like 3 hours to troubleshoot.
Edit: i reverted back to using the official published npm package instead of my fork, but this broke it again and i got the " Cannot find module './base.json'" Error again.
The text was updated successfully, but these errors were encountered: