1

I migrated a create-react-app to webpack unfortunately there are some mistake at compilation. But the mistake message is not significant to find where the error is coming from.

Is there a way to improve the log output of webpack compilation ?

My log output is :> webpack-dev-server --mode development --open --hot

<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.0.70:8080/
<i> [webpack-dev-server] Content not from webpack is served from 'E:\WORKSPACE\testpoub\web_simulation\public' directory
i 「atl」: Using typescript@4.8.4 from typescript
i 「atl」: Using tsconfig.json from E:/WORKSPACE/testpoub/web_simulation/tsconfig.json
× 「atl」: Child process failed to process the request: Error: Debug Failure. False expression.
    at resolveNamesWithLocalCache (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:123200:26)
    at Object.resolveModuleNames (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:123244:20)
    at Object.resolveModuleNames (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:125393:134)
    at actualResolveModuleNamesWorker (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:118239:153)
    at resolveModuleNamesWorker (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:118542:26)
    at resolveModuleNamesReusingOldState (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:118640:24)
    at processImportedModules (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:120165:35)
    at findSourceFileWorker (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:119945:17)
    at findSourceFile (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:119791:26)
    at processImportedModules (E:\WORKSPACE\testpoub\web_simulation\node_modules\typescript\lib\typescript.js:120200:25)
× 「atl」: Child process failed to process the request: TypeError: Cannot read property 'updateRootFileNames' of undefined
    at getProgram (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:152:10)
    at getEmitOutput (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:403:19)
    at emit (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:422:24)
    at processEmit (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:458:22)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:610:6
    at Object.send (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:49:6)
    at Checker.req (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\checker.ts:100:15)
    at Checker.emitFile (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\checker.ts:105:15)
    at transform (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\index.ts:130:26)
    at transformationFunction (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\index.ts:72:40)
(node:345424) UnhandledPromiseRejectionWarning: null
(Use `node --trace-warnings ...` to show where the warning was created)
(node:345424) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:345424) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
<i> [webpack-dev-middleware] wait until bundle finished: /
× 「atl」: Child process failed to process the request: TypeError: Cannot read property 'getProgram' of undefined
    at getProgram (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:154:16)
    at processFiles (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:468:11)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:616:6
    at Object.send (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\runtime.ts:49:6)
    at Checker.req (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\checker.ts:100:15)
    at Checker.getFiles (E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\checker\checker.ts:141:15)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\awesome-typescript-loader\src\instance.ts:483:34
    at Hook.eval [as callAsync] (eval at create (E:\WORKSPACE\testpoub\web_simulation\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (E:\WORKSPACE\testpoub\web_simulation\node_modules\webpack\node_modules\tapable\lib\Hook.js:18:14)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\webpack\lib\Compiler.js:1192:33
asset index_bundle.js 219 KiB [emitted] (name: main) 1 related asset
asset index.html 1.61 KiB [emitted]
runtime modules 27.4 KiB 12 modules
modules by path ./node_modules/ 160 KiB
  modules by path ./node_modules/webpack-dev-server/client/ 55.8 KiB 12 modules
  modules by path ./node_modules/webpack/hot/*.js 4.3 KiB
    ./node_modules/webpack/hot/dev-server.js 1.59 KiB [built] [code generated]
    ./node_modules/webpack/hot/log.js 1.34 KiB [built] [code generated]
    + 2 modules
  modules by path ./node_modules/html-entities/lib/*.js 81.3 KiB
    ./node_modules/html-entities/lib/index.js 7.74 KiB [built] [code generated]
    ./node_modules/html-entities/lib/named-references.js 72.7 KiB [built] [code generated]
    + 2 modules
  ./node_modules/ansi-html-community/index.js 4.16 KiB [built] [code generated]
  ./node_modules/events/events.js 14.5 KiB [built] [code generated]
./src/index.tsx 39 bytes [built] [code generated] [1 error]

ERROR in ./src/index.tsx
Module build failed: Error: Final loader (./node_modules/awesome-typescript-loader/dist/entry.js) didn't return a Buffer or String
    at processResult (E:\WORKSPACE\testpoub\web_simulation\node_modules\webpack\lib\NormalModule.js:774:17)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\webpack\lib\NormalModule.js:860:5
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\loader-runner\lib\LoaderRunner.js:407:3
    at iterateNormalLoaders (E:\WORKSPACE\testpoub\web_simulation\node_modules\loader-runner\lib\LoaderRunner.js:233:10)
    at iterateNormalLoaders (E:\WORKSPACE\testpoub\web_simulation\node_modules\loader-runner\lib\LoaderRunner.js:240:10)
    at E:\WORKSPACE\testpoub\web_simulation\node_modules\loader-runner\lib\LoaderRunner.js:255:3
    at context.callback (E:\WORKSPACE\testpoub\web_simulation\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

webpack 5.74.0 compiled with 1 error in 9115 ms
sancelot
  • 1,905
  • 12
  • 31

1 Answers1

0

finally, I used npm list to watch my packages and I found there were some missing dependencies. After fixing these dependencies issues it was right

sancelot
  • 1,905
  • 12
  • 31