Closed
Description
Describe the bug
Heya – thank you for maintaining Statoscope! Incredibly useful tool.
Since I upgraded to v5.25, Statoscope started crashing when loading the UI. The error reads like this:
statoscope-unnamed-187619ba9f701cb87367.html:78 Uncaught TypeError: n.subarray is not a function
at Object.inflate (statoscope-unnamed-187619ba9f701cb87367.html:78:38851)
at window.Pako.la.push (statoscope-unnamed-187619ba9f701cb87367.html:78:45733)
at statoscope-unnamed-187619ba9f701cb87367.html:1299:28
at Array.map (<anonymous>)
at Object.parse (statoscope-unnamed-187619ba9f701cb87367.html:1290:43)
at statoscope-unnamed-187619ba9f701cb87367.html:1327:24
The relevant line seems to be this (this is the only mention of .subarray()
in the diff between v5.24 and v5.25):
If you pause at the exception, you’ll notice n
is defined, it just doesn’t have the subarray
function (because it’s a regular array):
To Reproduce
Steps to reproduce the behavior:
-
Run
git clone git@github.com:appsmithorg/appsmith.git --depth 1 cd appsmith/app/client cp .env.example .env yarn
-
Install Statoscope:
yarn add @statoscope/webpack-plugin
-
Add Statoscope to
craco.common.config.js
:const StatoscopeWebpackPlugin = require("@statoscope/webpack-plugin").default; module.exports = { // ... webpack: { // ... configure: { // ... plugins: [new StatoscopeWebpackPlugin({ statsOptions: { all: true }, open: "file" })], } } }
-
Build the app:
yarn build
-
Observe how the report opens but hangs at “Parsing...”. Observe the above error in the JS console
Expected behavior
The report should load successfully.
Screenshots
Versions:
- Node (for non-browser bug):
- Browser (for browser-bug): 109.0.5414.119 (Official Build) (arm64)
- Webpack: 5.73.0
- Statoscope: 5.25