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.

Module not found error

See original GitHub issue

Overview

Importing produces the following error

Module not found: Can't resolve 'vis/dist/vis-timeline-graph2d.min' in '#############/node_modules/react-visjs-timeline/build'

Package versions

react-visjs-timeline: 1.4.0 vis version: 4.21.0

Steps to reproduce

import {Timelines as TL} from 'react-visjs-timeline';

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
inevcommented, Nov 3, 2017

@jason-weirather thank you for posting your code. I actually got it to work but it had other problems mentioned in other issues. For example, when you switched pages, it didn’t reload correctly. Since the library seems to be updated only occasionally I figured it’s safer to work with visjs directly like you did.

A couple pointers on your code:

  • You are going to want to use the ref attribute of react like the code below, it’s a lot cleaner.
  • Using the provided DataSet component will provide you with the two way binding so it auto updates.
componentDidMount() {
  this.timelineDataSet = new DataSet([]);
  this.timeline = new Timeline(this.refs.timeline, this.timelineDataSet, {
    //options
  });
  this.timeline.setWindow(this.oneMonthBefore, this.now);
}

render() {
  return <div ref="timeline"></div>;
}
1reaction
attila135786commented, Oct 18, 2020

I ended up installing vis-timeline instead of vis and it resolved the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
How to Fix ModuleNotFoundError and ImportError
How to fix ModuleNotFoundError and ImportError? · first make sure you are using absolute imports · export the project's root directory to ...
Read more >
Python - Module Not Found - Stack Overflow
I got the error ModuleNotFoundError: No module named 'requests.adapters'; 'requests' is not a package. Turns out the file I created in the same...
Read more >
Python ModuleNotFoundError Solution - Career Karma
The ModuleNotFoundError is raised when Python cannot locate an error. The most common cause of this error is forgetting to install a module...
Read more >
module-not-found - Next.js
Possible Ways to Fix It · The module you're trying to import is not installed in your dependencies · The module you're trying...
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