Comments (3)
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.
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.
I ended up getting it to work using sinon.stub(). Thanks for getting back with me.
from inject-loader.
Related Issues (20)
- Thanks HOT 1
- Webpack + coffeescript + inject-loader HOT 2
- Cannot find module HOT 18
- Any chance of transitive dependencies ? HOT 2
- Webpack 3 compatibility HOT 2
- Regression: When injecting a falsey export, it shouldn't fall back to real module HOT 3
- babelrc config not used HOT 1
- Not working with React Native packager? HOT 1
- Support code-coverage instrumentation HOT 2
- Add webpack v4 to peerDependencies HOT 2
- Work with Jest HOT 3
- Mocking out the 'request-promise' library HOT 1
- Add more tests HOT 1
- Calling require() with dynamically formed paths leads to runtime issue with webpack
- Cannot mock default and named exports together HOT 1
- Add support for Babel 7 HOT 8
- Nested dependencies? HOT 1
- TS-support
- Webpack version 5.x support? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inject-loader.