Skip to content
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

DAPR Workflow in JS SDK Fails When Minified Using Webpack #675

Open
anevjes opened this issue Mar 4, 2025 · 0 comments
Open

DAPR Workflow in JS SDK Fails When Minified Using Webpack #675

anevjes opened this issue Mar 4, 2025 · 0 comments

Comments

@anevjes
Copy link

anevjes commented Mar 4, 2025

Expected Behaviour
Should be able to minify a JS file (through say webpack) which makes use of Workflow SDK.

Actual Behaviour

Image

Workflow SDK in JS cannot deal with the minifed js file.

Steps to Reproduce the Problem
1.) Build sample DAPR based workflow (https://docs.dapr.io/developing-applications/sdks/js/js-workflow/)
2.) npm install --save-dev webpack webpack-cli terser-webpack-plugin
3.) Build a webpack config file:

// filepath: webpack.config.js
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
mode: 'production',
entry: './src/index.js', // Replace with the path to your main JS file
output: {
filename: 'bundle.min.js', // The output file name
path: __dirname + '/dist', // The output directory
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
};

4.) run webpack
npx webpack

5.) try to rerun dapr workflow js code thats been minified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants