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.

Error in Build regarding router-loader

See original GitHub issue

After following the instructions for routing from the documentation, and running the build script it errors out with the below:

ERROR in ./pages/container.js
Module build failed: TypeError: Cannot read property 'length' of null
    at Object.module.exports (.../loaders/route-loader.js:8:7)

Note:

For the route itself I am wrapping the component in a container using connect() from react-redux but shouldn’t kill the routing?

./src/routes.js image

./src/pages/index.js image

And here Component is simply pointing to a container component like:

import Component from './component'

function mapStateToProps() {
// some mapping here..
} 

export default connect(mapStateToProps)(Component)

Let me know if additional info is required ✌️

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tirthbodawalacommented, Nov 23, 2017

Please move the require("../styles/fonts.css") from routes to src/client.js As styles need to be managed via client it would make more sense and won’t hinder compilation of server.js

0reactions
tirthbodawalacommented, Nov 23, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Router 6 show error in element when using loader
I'm trying to show an error message on the same page if there's an error when loading a resource. However, when using loader...
Read more >
Angular production build error in nx version 13.7.1 · Issue #8768
I am experiencing this same error on nx 13.6.1 after updating (via nx migrate) @angular-devkit/build-angular from 13.1.2 to 13.2.0. This is ...
Read more >
Remixing React Router
Remix is able to co-locate loaders and actions with the route modules and builds the route config itself from a file system. We...
Read more >
Page Not Found Error on Netlify Reactjs React Router solved
React Router handles routing on the client-side (browser) so when you visit the non-root page (e.g. https://yoursite.netlify.com/login ), ...
Read more >
Routing: Fundamentals - Next.js beta docs
Next.js 13 introduced a new file-system based router built on top of React Server Components with support for layouts, nested routing, loading states,...
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