Skip to content

Verbose gives size [object Object] #73

Closed
@aakashchoubey

Description

@aakashchoubey

Steps to repro

I am running this line. I tried --verbose option for more visibility on numbers in cli.

react-native-bundle-visualizer --entry-file index.js --dev false --platform ios --bundle-output build/ios/main.jsbundle --verbose

With this, I was getting size field like this

---/node_modules/metro-config/node_modules/metro/src/lib/polyfills/require.js, size: [object Object] bytes
---/node_modules/react-native/Libraries/polyfills/console.js, size: [object Object] bytes
---/node_modules/react-native/Libraries/polyfills/error-guard.js, size: [object Object] bytes
---/node_modules/react-native/Libraries/polyfills/Object.es7.js, size: [object Object] bytes

Configuration

Package Version = react-native-bundle-visualizer@3.1.1 
Node Version = 14.18.0
Npm Version = 6.14.15

Fix

I tried updating this line to console bundle.files[file].size instead and the output was presented correctly as expected.

I did not dive into why this happens or if I am able to get the same on a different node version. But just found something and thought I should let people know here.
I'll update here once I have some time to check on different node versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions