serverless-plugin-optimize: Cannot work with prisma
Serverless: Typescript compiled.
Serverless: Optimize: starting engines
Serverless: Optimize: accounts-dev-main
Syntax Error -------------------------------------------
SyntaxError: Unexpected token (19074:12) while parsing /Users//services/node_modules/@prisma/client/runtime/index.js while parsing file: /Users//services/node_modules/@prisma/client/runtime/index.js
at DestroyableTransform.end [as _flush] (/Users//services/node_modules/insert-module-globals/index.js:114:21)
https://github.com/prisma/prisma/issues/5392#issuecomment-793100660
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 16
I’m switching to webpack and it works
@hoangtrieukd you save my life with these. confirm it works with these two line
custom: optimize: external: ['@prisma/client', '.prisma/client']
I’ve had to bend this plugin in a couple of hacky ways to make it work. It is not ready for NPM and I’m not willing to make it npm compatible until I’m able to clean up the patches a bit. You are welcome to use this branch if you need to. You can reference it directly in your
package.json
or fork and reference your own copy.Link to my fork: https://github.com/Album-Health/serverless-plugin-optimize
Best of luck.