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

Cannot destructure property 'time' of 'stats.toJson(...)' as it is null. #854

Closed
ra1nj opened this issue Jan 6, 2025 · 3 comments · Fixed by #883
Closed

Cannot destructure property 'time' of 'stats.toJson(...)' as it is null. #854

ra1nj opened this issue Jan 6, 2025 · 3 comments · Fixed by #883
Assignees
Labels
status:investigating The issue needs more research and information. type:bug A bug report.

Comments

@ra1nj
Copy link
Contributor

ra1nj commented Jan 6, 2025

Describe the bug

Upgrade the repack version to 5.0.0-rc.5, encountered:

[DevServer] Cannot destructure property 'time' of 'stats.toJson(...)' as it is null. {
  reqId: 'req-1',
  err: {
    type: 'TypeError',
    message: "Cannot destructure property 'time' of 'stats.toJson(...)' as it is null.",
    stack: "TypeError: Cannot destructure property 'time' of 'stats.toJson(...)' as it is null.\n" +
      '    at Object.fn (/Users/vn564c0/Repack/RepackApp1/node_modules/@callstack/repack/dist/plugins/LoggerPlugin.js:124:11)\n' +
      '    at next (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:523:25)\n' +
      '    at AsyncSeriesHook.callAsyncStageRange (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:543:9)\n' +
      '    at AsyncSeriesHook.callAsync (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:82:21)\n' +
      '    at Watching._done (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/core/dist/index.js:13245:30)\n' +
      '    at onCompile (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/core/dist/index.js:13215:14)\n' +
      '    at /Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/core/dist/index.js:13805:18\n' +
      '    at done (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:473:13)\n' +
      '    at AsyncSeriesHook.callAsyncStageRange (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:480:20)\n' +
      '    at AsyncSeriesHook.callAsync (/Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/lite-tapable/dist/index.js:82:21)\n' +
      '    at /Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/core/dist/index.js:13801:33\n' +
      '    at /Users/vn564c0/Repack/RepackApp1/node_modules/@rspack/core/dist/index.js:13845:37'
  }
} 

System Info

N/A

Re.Pack Version

5.0.0.rc.5

Reproduction

https://github.com/ra1nj/RepackHost/tree/rc.5 , https://github.com/ra1nj/RepackApp1/tree/rc.5

Steps to reproduce

  1. Clone the repo
  2. Install dependencies
  3. Run the dev server for the RepackApp1
@ra1nj ra1nj added status:new New issue, not reviewed by the team yet. type:bug A bug report. labels Jan 6, 2025
@jbroma jbroma added status:investigating The issue needs more research and information. and removed status:new New issue, not reviewed by the team yet. labels Jan 7, 2025
@jbroma jbroma self-assigned this Jan 7, 2025
@jbroma
Copy link
Member

jbroma commented Jan 7, 2025

Investigated it briefly, seems like in the mini app config the compilation breaks on the native (rust) side but the node process continues as normal returning stats as null (which according to the typescript definitions shouldn't be happening).

Seems like this is a problem within Rspack and should be upstreamed there, I'll take care of that 👍

@jbroma
Copy link
Member

jbroma commented Jan 7, 2025

I've updated the reproduction steps to reflect that this happens only within the mini app deve server

It looks like this is only happening when running with MF2

@jbroma
Copy link
Member

jbroma commented Jan 21, 2025

will be fixed in rc.8 released today 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:investigating The issue needs more research and information. type:bug A bug report.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants