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.

m.createRoutes is not a function

See original GitHub issue

The version latest: 1.2.0 have this bug on the compilation.

const ignoreStyles = require('ignore-styles');
const register = ignoreStyles.default;

const extensions = ['css', 'scss', 'sass', 'less'];

register(ignoreStyles.DEFAULT_EXTENSIONS, (mod, filename) => {
  if (extensions.find(f => filename.endsWith(f))) {
    return ignoreStyles.noOp();
  }
});

require('@babel/polyfill');
require('@babel/register');

const Sitemap = require('react-router-sitemap').default;
const router = require('./src/routes').default;

const filterConfig = {
  isValid: false,
  rules: [/\/admin/, /\*/],
};

const sitemap = (
  new Sitemap(router)
    .filterPaths(filterConfig)
    .build('https://mywebpage.net')
    .save('./sitemap.xml', '/build/')
);

On console:

$ node sitemap-builder.js 
/home/paneladm/projects/paneladm-dev/website/node_modules/react-router-sitemap/index.es5.js:1
(function (exports, require, module, __filename, __dirname) { module.exports=function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return e[n].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=r(1);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(u).default}}),Object.defineProperty(t,"sitemapBuilder",{enumerable:!0,get:function(){return u.sitemapBuilder}}),Object.defineProperty(t,"routesParser",{enumerable:!0,get:function(){return u.routesParser}}),Object.defineProperty(t,"pathsFilter",{enumerable:!0,get:function(){return u.pathsFilter}}),Object.defineProperty(t,"paramsApplier",{enumerable:!0,get:function(){return u.paramsApplier}})},function(e,t,r){"use strict";function n(e){r

TypeError: (0 , m.createRoutes) is not a function
    at new e (/home/paneladm/projects/paneladm-dev/website/node_modules/react-router-sitemap/index.es5.js:1:2101)
    at Object.<anonymous> (/home/paneladm/projects/paneladm-dev/website/sitemap-builder.js:25:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
francisrod01commented, Jan 31, 2019

I’m sorry for that. I was confused. Npm shows me the latest version usin npm info. Now it’s work.

1reaction
kuflashcommented, Feb 1, 2019

@francisrod01 it’s another question. Can you create separate issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: (0 , m.createRoutes) is not a function #81 - GitHub
Node Version: v8.12.0. Create-React-App. I have replicated the way it is used in the example, and get the error mentioned in the issue...
Read more >
TypeError: register.route(...).use is not a function
I'm using express.Router() whenever i try use method it gives the following error TypeError: register.route(...).use is not a function.
Read more >
Create Routes—Help | ArcGIS for Desktop
ArcGIS geoprocessing tool that creates routes from existing lines.
Read more >
Express Tutorial Part 4: Routes and controllers - MDN Web Docs
First we create routes for a wiki in a module named wiki.js. ... function to be called if the method does not complete...
Read more >
How to create routes with the MAKEPOINT and MAKELINE ...
In this week's tip, I show you how to use the makepoint and makeline functions that became available in Tableau 2019.2 to create...
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