Skip to content

Explicitly reference the loader - #4

Open
guusdk wants to merge 1 commit into
faassen:masterfrom
guusdk:patch-1
Open

Explicitly reference the loader#4
guusdk wants to merge 1 commit into
faassen:masterfrom
guusdk:patch-1

Conversation

@guusdk

@guusdk guusdk commented May 3, 2017

Copy link
Copy Markdown

By using the short name for a loader, another node module that matches the loader shortname might be used, giving weird errors. This is prevented by referencing the loader by its full name (by adding '-loader' to most short names).

This prevents errors like these:

/vagrant/node_modules/loader-runner/lib/loadLoader.js:35
                        throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)");
                        ^

Error: Module '/vagrant/node_modules/url/url.js' is not a loader (must have normal or pitch function)
    at loadLoader (/vagrant/node_modules/loader-runner/lib/loadLoader.js:35:10)
    at iteratePitchingLoaders (/vagrant/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/vagrant/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/vagrant/node_modules/webpack/lib/NormalModule.js:179:3)
    at NormalModule.build (/vagrant/node_modules/webpack/lib/NormalModule.js:268:15)
    at Compilation.buildModule (/vagrant/node_modules/webpack/lib/Compilation.js:142:10)
    at factoryCallback (/vagrant/node_modules/webpack/lib/Compilation.js:325:11)
    at factory (/vagrant/node_modules/webpack/lib/NormalModuleFactory.js:253:5)
    at applyPluginsAsyncWaterfall (/vagrant/node_modules/webpack/lib/NormalModuleFactory.js:99:14)
    at /vagrant/node_modules/tapable/lib/Tapable.js:204:11

By using the short name for a loader, another node module that matches the loader shortname might be used, giving weird errors. This is prevented by referencing the loader by its full name (by adding '-loader' to most short names).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant