GithubHelp home page GithubHelp logo

Comments (3)

sokra avatar sokra commented on April 20, 2024

For the first error you need to use the json-loader.

The second one is here: module.paths is not supported (is not even documented in the node.js documentation and it's not good style).

I would love to have more time to maintain enhanced-require, but webpack gets more traction and eats up my whole time...

from enhanced-require.

bitplanets avatar bitplanets commented on April 20, 2024

You also need to add extensions: ['', '.js', '.json'], to your webpack config. I'm also having problems on node.js... Not easy to fix.

from enhanced-require.

marr avatar marr commented on April 20, 2024

Interesting approach @ianbytchek. I was running into a similar issue around require.context when trying to run mocha tests on the browser. The command I ran was node node_modules/enhanced-require/bin/enhanced-require.js "mocha\!./test/index.js" and it errors with:

node node_modules/enhanced-require/bin/enhanced-require.js "mocha\!./test/index.js"

TypeError: Object #<Object> has no method 'ui'
    at Object.Mocha (/Users/dmarr/src/webpack-with-common-libs/node_modules/mocha/lib/mocha.js:83:8)
    at WEBPACK_CORE_LOADER_EXECUTION (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:131:71)
    at runSyncOrAsync (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:131:93)
    at nextLoader (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:233:3)
    at Storage.finished (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at SyncNodeJsInputFileSystem.readFile (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/SyncNodeJsInputFileSystem.js:19:4)
    at Storage.provide (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:56:2)
    at CachedInputFileSystem.readFile (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:134:24)
    at NormalModuleMixin.onLoadPitchDone (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:204:7)
    at NormalModuleMixin.loadPitch (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:157:27)

I guess this is mocha-loader's fault but i'm not certain. I filed a bug there: webpack-contrib/mocha-loader#17

from enhanced-require.

Related Issues (14)

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.