You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Node application running in AWS Lambda. For the local development, I use the serverless framework and test locally. But today I faced a strange issue. When deploying to Lambda, I first run it through Webpack to bundle. So it does not work when lambda is invoked but works locally.
So as my local setup is not going through Webpack I uploaded with node modules to the lambda env to be sure if webpack is the one causing the issue. And yes, it's working fine when not ran through webpack to bundle.
I found that changing target and libraryTarget combinations works. But this is not the case for a huge project base that gets bundled together. So why XRegExp is behaving like this?
The text was updated successfully, but these errors were encountered:
Hey guys,
I have a Node application running in AWS Lambda. For the local development, I use the serverless framework and test locally. But today I faced a strange issue. When deploying to Lambda, I first run it through Webpack to bundle. So it does not work when lambda is invoked but works locally.
So as my local setup is not going through Webpack I uploaded with node modules to the lambda env to be sure if webpack is the one causing the issue. And yes, it's working fine when not ran through webpack to bundle.
So I created a small script
I ran this normally through the node command. Gives an output without an error.
Then bundled through webpack and ran the output with the node command. Errors out saying
TypeError: XRegExp is not a function
Here is my simple webpack config
const path = require('path');
I found that changing
target
andlibraryTarget
combinations works. But this is not the case for a huge project base that gets bundled together. So why XRegExp is behaving like this?The text was updated successfully, but these errors were encountered: