rsdoctor icon indicating copy to clipboard operation
rsdoctor copied to clipboard

[Bug]: worker got Error TypeError [Error]: Cannot read properties of undefined (reading 'app')

Open mdddj opened this issue 7 months ago • 3 comments

Version

"@rsdoctor/rspack-plugin": "^1.1.2",
 "@rsdoctor/webpack-plugin": "^1.1.0",

Details

error - TypeError: Cannot read properties of undefined (reading 'then')
    at RsdoctorWebpackPlugin.beforeRun (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/dist/plugin.js:82:33)
    at tap.fn (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/core/dist/inner-plugins/utils/plugin.js:99:20)
    at Hook.eval [as callAsync] (eval at create (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:7682), <anonymous>:45:17)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:4851)
    at run (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@umijs/bundler-webpack/compiled/webpack/index.js:63019:25)
    at Compiler.run (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@umijs/bundler-webpack/compiled/webpack/index.js:63042:4)
    at /Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__@[email protected]_@ty_3160ce6ae5f17d7c4762c4e9b16a03dc/node_modules/@umijs/preset-umi/dist/commands/dev/depBuildWorker/depBuilder.js:57:16
    at new Promise (<anonymous>)
    at DepBuilderInWorker.buildWithWebpack (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__@[email protected]_@ty_3160ce6ae5f17d7c4762c4e9b16a03dc/node_modules/@umijs/preset-umi/dist/commands/dev/depBuildWorker/depBuilder.js:55:12)
    at DepBuilderInWorker.build (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__@[email protected]_@ty_3160ce6ae5f17d7c4762c4e9b16a03dc/node_modules/@umijs/preset-umi/dist/commands/dev/depBuildWorker/depBuilder.js:126:20)
error - [MFSU][eager] worker got Error TypeError [Error]: Cannot read properties of undefined (reading 'app')
    at get app [as app] (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/index.js:84:25)
    at RsdoctorServer.post (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/index.js:62:15)
    at /Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/router.js:62:20
    at Array.forEach (<anonymous>)
    at /Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/router.js:60:11
    at Map.forEach (<anonymous>)
    at /Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/router.js:59:27
    at Array.forEach (<anonymous>)
    at _Router.setup (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/router.js:50:10)
    at RsdoctorServer.bootstrap (/Users/hlx/github/blog/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@rsdoctor/webpack-plugin/node_modules/@rsdoctor/sdk/dist/cjs/sdk/server/index.js:125:24)

Reproduce link

https://github.com/mdddj/blog

Reproduce Steps

pnpm install
pnpm run start

mdddj avatar May 09 '25 01:05 mdddj

I tried using your reproduce demo and executed pnpm i and pnpm run build, but I couldn't reproduce the error. You might want to try deleting the node_modules folder and reinstalling.

Image

yifancong avatar May 09 '25 10:05 yifancong

run build 没有问题,run start 启动的时候会报错

Image

mdddj avatar May 10 '25 01:05 mdddj

We recommend using it under build. https://rsdoctor.dev/zh/guide/start/quick-start

I'll take a look at the problem of start later.

yifancong avatar May 12 '25 03:05 yifancong

There has been no reply for too long. It is about to be closed. If there is any problem, you can reply again.

yifancong avatar Jun 18 '25 03:06 yifancong