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

EMBROIDER_CONCAT_STATS breaks the build #1523

Closed
Windvis opened this issue Jul 11, 2023 · 0 comments · Fixed by #1524
Closed

EMBROIDER_CONCAT_STATS breaks the build #1523

Windvis opened this issue Jul 11, 2023 · 0 comments · Fixed by #1524

Comments

@Windvis
Copy link
Collaborator

Windvis commented Jul 11, 2023

I'm following the analyze.md guide and when I try the EMBROIDER_CONCAT_STATS=true npm run build command the build fails with the following error:

(0 , filesize_1.filesize) is not a function

Looking at the stack trace and related code, it points to this line:

.map(([name, bytes]) => ` ${name}: ${filesize(bytes, {})}`)

Or the compiled version:

            .map(([name, bytes]) => `  ${name}: ${(0, filesize_1.filesize)(bytes, {})}`)

It seems that v5 of the filesize package only has a default export but since it's imported as a named import in the code it fails.

This is the commit that introduced that change: 1d350d9#diff-cfbd9511262fbeca1aa6e2e563f54f6852e46b3ba0db0d1381d693d11fdca2a8L4

The latest version of filesize does support the named import, so I think updating to that should fix this problem. Manually updating the code in node_modules so it uses the default export fixed the issue locally. Forcing it to the latest version with overrides also worked.

I can create a PR but guidance would be appreciated if tests are needed.

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

Successfully merging a pull request may close this issue.

1 participant