Radu28 Posted March 5 Posted March 5 I’m having some trouble using the latest Prisma Client in my server. The generated Prisma code uses ES2021 syntax—specifically, the nullish assignment operator (??=)—which causes runtime errors. Here’s what’s happening: • When I build my project with Rollup and SWC targeting ES2019, I get errors like “Unexpected token ‘??=’” when the server runs. • Also, there are module export issues coming from Prisma (like “Package subpath ‘./runtime/library.js’ is not defined by ‘exports’” in the Prisma Client package). I’ve tried to configure SWC to transpile everything by including Prisma paths, but it still fails. I also tried marking Prisma as external so it wouldn’t get bundled, but then the runtime still hits the unsupported ES2021 syntax. How to Reproduce: 1. Use the latest Prisma Client in a project. 2. Build with Rollup & SWC targeting ES2019. 3. Run the server in RAGE:MP. 4. See the error about the ??= operator and module export issues. Question: Has anyone here managed to bundle Prisma Client for RAGE:MP (or any ES2019 environment) successfully? How did you handle the modern syntax (like ??=) and export issues? Any tips, tricks, or workarounds would be awesome. Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now