TypeError: mitt is not a function
See original GitHub issueDo 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:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Answered here: lgraubner/sitemap-generator-cli#32