Skip to content

Instantly share code, notes, and snippets.

@js08
Created April 11, 2016 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save js08/1d086e2466ece48201101a84aaafcb52 to your computer and use it in GitHub Desktop.
Save js08/1d086e2466ece48201101a84aaafcb52 to your computer and use it in GitHub Desktop.

I have a react js code.

  • I am trying to import other modules into my jsx.

  • for all other modules its working fine.

  • but for this module sports-display-container alone its expecting path which is not the correct way.

  • can you guys tell me how to debug the import statements to make the sports-players to make it work by not mentioning the path name

  • providing the import staments code alone below **- sports-display-container --- is a separate module

  • working: import Display from '../../../sports-display-container';**

  • not-working: import Display from 'sports-display-container';

  • is there a way to debug import staments separately

  • even package.json is fine for sports-display-container

    code

    
    import React from 'react';
    import BasketballPage from './template';
    import BasketballPageCaptain from './template-captain';
    import './display.css';
    import Display from 'sports-display-container';
    import {cricketDisplay, volleyBallDisplay, soccerDisplay} from '../utils/display-utils';
    
    error: 
    - cannot find module sports-display-container
    
    
@randomradio
Copy link

what is the structure of your project diretory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment