You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I attempt to build my project, I find the following error:
TypeError: childCompilation.errors.map is not a function
at /cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/html-rspack-plugin@5.6.2_@rspack+core@0.6.1/node_modules/html-rspack-plugin/lib/child-compiler.js:166:56
at finalCallback (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@rspack+core@0.6.1_@swc+helpers@0.5.3/node_modules/@rspack/core/dist/Compiler.js:223:17)
at /cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@rspack+core@0.6.1_@swc+helpers@0.5.3/node_modules/@rspack/core/dist/Compiler.js:250:20
at /cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@rspack+core@0.6.1_@swc+helpers@0.5.3/node_modules/@rspack/core/dist/Compiler.js:423:28
at Hook.eval [as callAsync] (eval at create (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at Hook.CALL_ASYNC_DELEGATE [as callAsync] (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:18:14)
at /cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@rspack+core@0.6.1@swc+helpers@0.5.3/node_modules/@rspack/core/dist/Compiler.js:419:41
at /cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@rspack+core@0.6.1_@swc+helpers@0.5.3/node_modules/@rspack/core/dist/Compiler.js:743:65
Looking at the code, it appears that the code expects childCompilation.errors to be an array, but it is actually an iterator, which doesn't (yet) have a map method.
Expected behaviour ☀️
If I make the minimal change to get this working - changing childCompilation.errors.map to Array.from(childCompilation.errors).map - I get the compiler error I was expecting:
Failed to compile, check the errors for troubleshooting.
× JSONError { path: "/cloudide/workspace/fe_mono/apps/bernardTem/tsconfig.json", message: "invalid type: string \"./src/*\", expected a sequence at line 15 column 29", line: 15, column: 29 }
Reproduction Example 👾
I don't know how to easily reproduce this in a public fashion, because I have a Typescript project. The underlying reason for the error is that I set an entry in the compilerOptions.paths.[path] of tsconfig.json to be a string rather than an array of strings. See the following:
Current behaviour 💣
When I attempt to build my project, I find the following error:
Looking at the code, it appears that the code expects
childCompilation.errors
to be an array, but it is actually an iterator, which doesn't (yet) have amap
method.Expected behaviour ☀️
If I make the minimal change to get this working - changing
childCompilation.errors.map
toArray.from(childCompilation.errors).map
- I get the compiler error I was expecting:Reproduction Example 👾
I don't know how to easily reproduce this in a public fashion, because I have a Typescript project. The underlying reason for the error is that I set an entry in the
compilerOptions.paths.[path]
of tsconfig.json to be a string rather than an array of strings. See the following:The error entry is
"@project/*": "./src/*"
. Changing that to"@project/*": ["./src/*"]
fixes the compilation error.Environment 🖥
The text was updated successfully, but these errors were encountered: