Search code examples
node.jsmeteorwebpackopen-source

Module Not Found from git url dependency


I have forked react-flexbox-grid to add support for hidden-columns (this is my first time contributing) but I'm unable to include the package in my project.

Per the Docs: Git Urls as Dependencies, I put the following in my package.json:

    "react-flexbox-grid": "falieson/react-flexbox-grid#hidden-columns",

After running npm i, I see that npm fetched and had no errors installing the package.

├── react-dom@15.4.1 ├── react-flexbox-grid@0.10.2 (git://github.com/falieson/react-flexbox-grid.git#f8e9e9053430b619f4c7fd79b90ccd4f44d6a05c) ├── react-fontawesome@1.5.0

But when I start the server meteor:webpack complains:

ERROR in ./imports/ui/Home/index.jsx Module not found: Error: Cannot resolve module 'react-flexbox-grid' in /Users/falieson/Code/planetx-boilerplate/imports/ui/Home

I haven't changed anything on the index.jsx

import {Grid, Row, Col} from 'react-flexbox-grid';

Here's my meteor webpack config:

{
 "css": {
   "module": true
 },
 "module": {
   "loaders": [
     {
       "test": "/\\.css$/",
       "loader": "style!css?modules",
       "include": "/flexboxgrid/"
     }
   ]
 }
}

Solution

  • The issue is that this repo need to be build, the package.json is refering to the ./lib/index.js file but it doesn't exists in the repo (only src folder).

    You can build it localy with:

    npm run compile
    

    and force add and push the ./lib folder to your git repo.