4

I have created jss project with react template, and I have added typescript support by installing some typescript libraries and adding to server.webpack.config.js next config:

module: {
rules: [
{
 test: /.(ts|tsx)?$/,
 exclude: /node_modules/,
 use: {
  loader: 'babel-loader',
  options: {
  babelrc: false,
  presets: [env, reactApp],
}...

and adding additional logic of checking ts/tsx extensions to generate-component-factory.js.

In connected mode everything is ok, but in integrated mode, after deploying I see desirable rendering but with styles which Sitecore adds if cannot find rendering.

In logs, I see errors like

Placeholder jss-main contains unknown component Header. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.

Screenshots

Integrated Mode
image

Connected Mode
image

Using only js instead of ts everything works as expected. Has anyone come across a similar?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.