question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

info.message.replace is not a function when viewing a Component

See original GitHub issue

Expected Behavior

I should be able to view my component in the catalog.

Current Behavior

After the last upgrade, I am getting a series of the same error, info.message.replace is not a function when viewing a component, this was working fine 2 releases ago.

image

Possible Solution

Steps to Reproduce

  1. Open Component
  2. Same error shows multiple times

Context

Your Environment

  • NodeJS Version (v14): Node16
  • Operating System and Version (e.g. Ubuntu 14.04): Win10
  • Browser Information: Chrome and Edge

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
regicsolutionscommented, Dec 2, 2021

@freben i have confirmed your fix in the latest release fixed my issue, Thank You!

0reactions
regicsolutionscommented, Dec 2, 2021

Thanks, ill give it another try with the latest release.

Question: This is how i have been using replaceProcessors in my backend catalog.ts (been working fine since release-2021-11-17.1)

  builder.replaceProcessors([
    new ScaffolderEntitiesProcessor(),
    new FileReaderProcessor(),
    BitbucketDiscoveryProcessor.fromConfig(env.config, {
      parser: customBitbucketRepositoryParser,
      logger: env.logger,
    }),
    LdapOrgReaderProcessor.fromConfig(env.config, {
      logger: env.logger,
      groupTransformer: customGroupTransformer,
      userTransformer: customUserTransformer,
    }),
    new UrlReaderProcessor({ reader: env.reader, logger: env.logger }),
    new LocationEntityProcessor({ integrations }),
    new AnnotateLocationEntityProcessor({ integrations }),
  ]);
  

Given FileReaderProcessor, UrlReaderProcessor and AnnotateLocationEntityProcessor are being returned as part of the getDefaultProcessors:

https://github.com/backstage/backstage/blob/c2da6492fb917002517a54638e1da6fa523f2a8f/plugins/catalog-backend/src/service/NextCatalogBuilder.ts#L289

Would i just add it like this?

  builder.replaceProcessors([
    new ScaffolderEntitiesProcessor(),
    BitbucketDiscoveryProcessor.fromConfig(env.config, {
      parser: customBitbucketRepositoryParser,
      logger: env.logger,
    }),
    LdapOrgReaderProcessor.fromConfig(env.config, {
      logger: env.logger,
      groupTransformer: customGroupTransformer,
      userTransformer: customUserTransformer,
    }),
    new LocationEntityProcessor({ integrations }),
  ]);
// Gets Default Processors 
    builder.getDefaultProcessors();
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: replace is not a function in JavaScript | bobbyhadz
The "replace is not a function" error occurs when we call the replace() method on a value that is not of type string...
Read more >
var.replace is not a function - javascript - Stack Overflow
To fix this, you can make str a string, like this: str.toString().replace(...) ...as alper pointed out below.
Read more >
Content.replace is not a function (Example) - Treehouse
The "Content.replace is not a function" just means that the "fileContents" argument isn't a string, which could be something that doesn't even ...
Read more >
Solved: "replaceAll is not a function" JavaScript TypeError
Learn how to fix the "replaceAll() is not a function" JavaScript error.
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
Maybe there is a typo in the function name? Maybe the object you are calling the method on does not have this function?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found