Giter VIP home page Giter VIP logo

Comments (3)

huumanoid avatar huumanoid commented on May 29, 2024

Hello @sgriffin916.
I've cloned this repo under my windows:

git clone https://github.com/plasticine/inject-loader.git
cd inject-loader/example/webpack2-babel
npm install
npm run test

As a result, I've experienced the same issue!

But after I've mentioned that there is indeed no inject-loader in both node_modules and ../.. (see webpack.conf.js -> resolveLoader.modules)

To launch tests successfully, I've run the following command in inject-loader/example/webpack2-babel:
npm install inject-request
OR

cd ../..
npm install # i.e. I've performed npm install for the root of the repo

Have you performed npm install for both the example and the main project?

So... That's it. For some reason, webpack is unable to find inject-loader in your project. Probably, it would be helpful if you provide us your webpack config.

from inject-loader.

sgriffin916 avatar sgriffin916 commented on May 29, 2024

So doing npm install inject-loader got the example project for me working. Inspired, I did the following on my project, running the tests after all three and all three still failed. Bummer.

  • npm install inject-loader
  • npm install --save-dev inject-loader
  • npm install --save inject-loader

I did discover that if I change it from -
const inject = require("inject-loader!EnsureLoggedIn");
to -
const inject = require("inject-loader!./../../src/containers/EnsureLoggedIn");
that I don't get the module not find error message but inject is not a function error.

Attached is my webpack config file.
webpack.txt

Thanks!

from inject-loader.

sgriffin916 avatar sgriffin916 commented on May 29, 2024

I ended up getting it to work using sinon.stub(). Thanks for getting back with me.

from inject-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.