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.

TypeError: mitt is not a function

See original GitHub issue

Do you want to request a feature or report a bug? bug

What is the current behavior? Error: TypeError: mitt is not a function

If the current behavior is a bug, please provide the steps to reproduce.

export const sitemap = (host: string) => new Promise<string>((resolve, reject) => {
  var generator = SitemapGenerator(host, {
    crawlerMaxDepth: 3,
    stripQuerystring: false
  });

  generator.on('done', (stats) => {
    console.log(`sitemap generation finished: ${stats}`);
    return resolve(stats);
  });

  generator.on('error', (err) => {
    console.log(`sitemap generator error: ${err}`);
    return reject(err);
  });

  generator.on('ignore', (url) => {
    console.log(`sitemap generator will ignore url: ${url}`); 
  });

  console.log(`sitemap generator crawler starting on ${host}`);
  generator.start();
});

sitemap("localhost:4000")
        .then(a => console.log('ok'))
        .catch(err => console.log(`error: ${err}`));

What is the expected behavior? Generated sitemap.xml

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lgraubnercommented, Sep 13, 2018

It doesn’t matter what you use for your stack. The important thing is, that you use SSR, what you are obviously doing. Deploy your app as you would normally and create the sitemap afterwards. Simplest way would be to use the CLI.

0reactions
lgraubnercommented, Sep 14, 2018

Answered here: lgraubner/sitemap-generator-cli#32

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: mitt is not a constructor · Issue #60 - GitHub
Im trying to use mitt in our react project using typescript. But I get this error in runtime: Uncaught TypeError: mitt is not...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This error occurs if you try to execute a function that is not initialized or is not initialized correctly.
Read more >
Uncaught TypeError: emit is not a function in vue3
I want to get the user input username from the template input.Seems did not work this way. what should I do to fix...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
Uncaught TypeError: Cannot set property '$' of undefined
Try taking var dt = require("datatables.net")(window, $); out of the document ready function. Just put it below the var $ = jQuery; ....
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