node-redis
node-redis copied to clipboard
Error: Webpack compilation error
We are using Redis cache in our Node JS Typescript Lambda API. Also we using webpack to run or build the API. While running the API we get Webpack compilation error . Please find the details below
ERROR in ./node_modules/redis/dist/index.js Module parse failed: Unexpected token (27:4) You may need an appropriate loader to handle this file type. | __exportStar(require("@node-redis/time-series"), exports);
Environment:
- Node.js Version: nodejs14.x
- Redis Server Version: 6.2.5
- Node Redis Version:^4.0.4
- Platform: Windows 10
@sivadgit you can include your webpack configuration. Where do you run Lambda API? Why do you have to transpile the files? :thinking:
I'm facing a similar problem:
this is my webpack configuration:
module.exports = config => {
return {
...config,
externals: [
{
'aws-sdk': 'aws-sdk',
'bufferutil': 'bufferutil',
'utf-8-validate': 'utf-8-validate',
},
],
output: {
...config.output,
},
};
};
Why are you trying to use it with webpack?
I'm facing a similar problem:
this is my webpack configuration:
module.exports = config => { return { ...config, externals: [ { 'aws-sdk': 'aws-sdk', 'bufferutil': 'bufferutil', 'utf-8-validate': 'utf-8-validate', }, ], output: { ...config.output, }, }; };
Please upgrade to latest version of Webpack and try again.
My webpack version is 4.46.0. I am facing with the same problem. Which version webpack shall I use?
I'm facing a similar problem:
this is my webpack configuration:
module.exports = config => { return { ...config, externals: [ { 'aws-sdk': 'aws-sdk', 'bufferutil': 'bufferutil', 'utf-8-validate': 'utf-8-validate', }, ], output: { ...config.output, }, }; };
Do you solve the problem?
https://github.com/facebook/create-react-app/issues/9468#issuecomment-694191642 seems to have solved mine
node v14 does not work with the latest version of node-redis. Please use node v12 or v16.
optional chaining is part of webpack5 (see: https://github.com/webpack/webpack/issues/10227#issuecomment-642734920) upgrading to webpack5 fixed for me
i can't upgrade to webpack v5 with razzle
Hi guys, I am facing the same problem, did you find a solution ? Nuxt 2.17.2 with Webpack 4, Babel 7, Node 20.10.0 Thanks