bower-webpack-plugin icon indicating copy to clipboard operation
bower-webpack-plugin copied to clipboard

Cannot resolve 'file' or 'directory' ./dist/debug.js

Open neekychan opened this issue 9 years ago • 8 comments

qq 20160222003605

Something wrong when i require 'Swiper' from bower

neekychan avatar Feb 21 '16 16:02 neekychan

I have the same issue even if i try to only install the plugin and not to require any components. I'm wondering if this could be related to the fact that debug.jsis located in the ../debug folder and not inside any dist folder. How do we fix that?

iosonosempreio avatar Mar 17 '16 10:03 iosonosempreio

UPDATE: I can confirm that if I manually create the dist folder, the error disappears.

iosonosempreio avatar Mar 17 '16 10:03 iosonosempreio

+1

YannickBochatay avatar Mar 31 '16 12:03 YannickBochatay

Same problem.

korzhyk avatar Apr 01 '16 22:04 korzhyk

Are you sure webpack should be looking in 'node_modules'? Did you manually rename your bower directory to that?

pakdev avatar Apr 26 '16 16:04 pakdev

I have the same problem. I made manually the dist folder but it doesn't resolve the problem

rkmax avatar May 31 '16 15:05 rkmax

See final comment of https://github.com/visionmedia/debug/issues/242 for working fix

jlsutherland avatar Sep 18 '16 19:09 jlsutherland

@jlsutherland there is not a nice solution if you want to install packages with npm/yarn but this packages actually just a Bower packages without any module system (like angular-bootstrap-toggle).

I solved the issue in the following quick and ugly way (add to Webpack config):

      externals: [
        (context, request, callback) => {
          if (request == 'debug')
            callback(null, 'function(namespace) { return namespace; }');
          else callback();
        }
      ]

It just replaces debug module with empty function. It will not work if you need working debug module.

sza-1 avatar Oct 28 '16 09:10 sza-1