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

Not working for Webpack 5 #95

Open
john-jay opened this issue Apr 14, 2021 · 9 comments
Open

Not working for Webpack 5 #95

john-jay opened this issue Apr 14, 2021 · 9 comments

Comments

@john-jay
Copy link

john-jay commented Apr 14, 2021

My build seems to complete (progress 100%), but then it fails processing the stats. It works on my PC but not on Azure DevOps. I am using webpack 5.32.0,

##[error]TypeError: stats.jsonToString is not a function
##[debug]Processed: ##vso[task.issue type=error;]TypeError: stats.jsonToString is not a function
TypeError: stats.jsonToString is not a function
at Object.compile (D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\webpackCompiler\WebpackCompiler.js:60:23)
at D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\index.js:43:46
at next (native)
at D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\index.js:7:71
at __awaiter (D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\index.js:3:12)
at run (D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\index.js:15:12)
at Object. (D:\VSOAGENT1_work_tasks\webpack_6752a610-c2f3-11e6-949e-5d3841f133f1\4.2.0\index.js:53:1)

@john-jay
Copy link
Author

From Q&A: The jsonToString method no longer exists in Stats.js [for WP5].
By Kwang Suh 10/30/2020

@DunnJM
Copy link

DunnJM commented Apr 15, 2021

I'm having the same issue

@jasonproulxFIRST
Copy link

I am having the same issue. Works locally but get the same error as you on Azure DevOps Pipeline. I am using webpack 5.44.0 and webpack-cli 4.7.2

If you have solved it, I would love to know how!

@wioletag
Copy link

wioletag commented Oct 8, 2021

@DunnJM @john-jay @jasonproulxFIRST were you able to solve this? facing the same issue

@jasonproulxFIRST
Copy link

@DunnJM @john-jay @jasonproulxFIRST were you able to solve this? facing the same issue

Yes. The Azure Pipeline Task was using version 4.XX of Webpack which seems to be the newest version available for Azure Tasks. For the local compilation of webpack we use Yarn, so I added a Yarn task with the same command and args as what we do locally and it worked. Not sure if this would apply to your environment, but this is how it ended up working for me. Good luck!

@DunnJM
Copy link

DunnJM commented Oct 11, 2021

@DunnJM @john-jay @jasonproulxFIRST were you able to solve this? facing the same issue

Yep! Essentially did the same as @jasonproulxFIRST, just with a custom npm task.

@DanielLavrushin
Copy link

@DunnJM @jasonproulxFIRST
I experience the same issue. What is the custom npm task command you used to solve this issue? Could you share the details please.

@DanielLavrushin
Copy link

okay, after spending a little time I found this solution
use a CMD task with follwoing command
node ".\node_modules\webpack\bin\webpack.js" --json --mode production --output-path "$(Build.BinariesDirectory)\dist"

@PilotBob
Copy link

PilotBob commented Jul 7, 2022

okay, after spending a little time I found this solution use a CMD task with follwoing command node ".\node_modules\webpack\bin\webpack.js" --json --mode production --output-path "$(Build.BinariesDirectory)\dist"

So you solution was not to use this plugin. lol. Ok. Guess there's no chance on this getting fixed either. So, I'll probably make the same choice.

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

No branches or pull requests

6 participants