Skip to content

Unable to integrate react-compiler-webpack with webpack config when ts is used #9

Closed
@morphy76

Description

@morphy76

Hello

To replicate, set up a react project to use typescript and webpack (so far... of course).
The outcome from webpack-cli is a webpack.config.ts config file.
Then start to apply the changes documented to install react-compiler-webpack.

The first issue is that

options: defineReactCompilerLoaderOption({}),

is not allowed; at a first glance, it seems that's because that ReactCompilerLoaderOption extends PluginOptions having several mandatory attributes and the webpack config file is typescript itself.

Removing the options, the compilation fails; to get you an idea, errors like that:

`
ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx
./src/components/SayHello.tsx 1:9-10
[tsl] ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx(1,10)
TS2305: Module '"react/compiler-runtime"' has no exported member 'c'.
@ ./src/index.tsx 3:0-49 11:28-36

ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx
./src/components/SayHello.tsx 84:15-19
[tsl] ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx(84,16)
TS7006: Parameter 'prev' implicitly has an 'any' type.
@ ./src/index.tsx 3:0-49 11:28-36

ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx
./src/components/SayHello.tsx 87:16-22
[tsl] ERROR in /Users/R.Pasquini/Projects/side/simplified-fe-server/web/ui/src/components/SayHello.tsx(87,17)
TS7006: Parameter 'prev_0' implicitly has an 'any' type.
@ ./src/index.tsx 3:0-49 11:28-36
`

Config files are atached to this issue

package.json

webpack.config.ts.change.from.json

tsconfig.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions