Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module build failed #4

Closed
simkessy opened this issue Dec 22, 2015 · 27 comments
Closed

Module build failed #4

simkessy opened this issue Dec 22, 2015 · 27 comments
Milestone

Comments

@simkessy
Copy link

I followed the instructions but I keep getting errors:

ERROR in ./~/css-loader!./~/sass-loader!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js
Module build failed:
module.exports = {};

^
      File to import not found or unreadable: ..♂ootstrap-sass
ssetsstylesheets♂ootstrap_variables
Parent style sheet: stdin
      in C:\Users\Administrator\Dropbox\projects\spDash\node_modules\bootstrap-loader\no-op.js (line 1, column 1)
 @ ./~/style-loader!./~/css-loader!./~/sass-loader!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js 4:14-121

My entry file looks like this:

require('expose?$!expose?jQuery!jquery');
require('angular');
require('angular-animate');
require('angular-sanitize');
require('angular-resource');
require('angular-ui-bootstrap');
require('angular-ui-router');
require('angular-ui-select/select');
require('datatables');
require('datatables-tabletools');
require('expose?moment!moment')
require('jquery-ui');
require('lodash');
require('expose?Promise!bluebird');
require('expose?toastr!toastr');
require('../../lib/jquery.SPServices-2014.02');
require('bootstrap-loader');

Webpack config:

var webpack = require('webpack')
module.exports = {
  entry: {
    'spdash': './app/js/loader.js'
  },
  output: {
    filename: 'bundle.js',
  },
  // devtool: 'source-map',
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      minimize: true,
      compress: {
        warnings: false
      }
    }),
    new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/])
  ]
};

And I have all the loaders setup

@bmanturner
Copy link

Had same issue just using 'bootstrap-loader' entry point.

@justin808
Copy link
Member

@simkessy @bmanturner Can you please compare your setup to https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client/webpack.client.rails.hot.config.js#L22

Are both of you on Windows. Neither @alexfedoseev nor I have windows boxes to test on. We'd appreciate any PRs to making this work on Windows.

@simkessy, you pasted:

      File to import not found or unreadable: ..♂ootstrap-sass

Note the 'b' in bootstrap is not a b.

@justin808
Copy link
Member

Actually, it looks like we're escaping all the characters following the ''. Maybe we need double backslashes.

@simkessy
Copy link
Author

@justin808 I ended up figuring out how to get bootstrap.css from the node_module

require('bootstrap');
require('bootstrap/dist/css/bootstrap.css');

So I'm not using boostrap-loader at the moment. But yea sometimes in windows you need double backslahes but I can't confirm. Thanks for the response though

@justin808
Copy link
Member

This issue could be related: shakacode/bootstrap-sass-loader#14 @fcaballero, any ideas?

@justin808 justin808 added this to the 1.0.0 milestone Dec 22, 2015
@fcaballero
Copy link

Hi @justin808, I have no idea why is happening this, I just see the code and it's changed the backslashes, unfortunately I'm not able to find a solution and debug the code since I no longer use windows :( because of this sort of problems...
If I find a windows machine I could try to find why the error, maybe I'll install a VM but after Xmas

@alex35mil
Copy link
Member

@simkessy @bmanturner Do you use custom .bootstraprc? If you do, please, put or uncomment this line:

loglevel: debug

Run build and post here output from console + contents of your .bootstraprc.

If you don't have custom .bootstraprc, please run your build like this:

DEBUG=* your-build-command

And post here output from console.

Thanks!

@jeffhertzler
Copy link

@simkessy Are you sure you are running 1.0.0-rc? I was having a similar issue and it was just because the default npm install gives you version 0.0.5. Windows support for sass imports was added here 89e51df.

npm install --save-dev bootstrap-loader@1.0.0-rc

@alex35mil
Copy link
Member

Btw 1.0.0-rc was published as latest, so it should be installed without providing version number. The only case when you must provide version explicitly — you have bootstrap-loader@0.x.x already installed.

@jeffhertzler
Copy link

Hmm. Just tested this by clearing my npm cache and uninstalling bootstrap-loader (and also double checking that the entry was indeed removed from package.json). I still get 0.0.5 by default on install.

@alex35mil
Copy link
Member

@jeffhertzler Can you post output of npm show bootstrap-loader?

@jeffhertzler
Copy link

{ name: 'bootstrap-loader',
  description: 'Boostrap for Webpack',
  'dist-tags': { latest: '1.0.0-rc', 'ver0.1.0-beta1': '0.1.0-beta1' },
  versions:
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.4',
     '0.0.5',
     '0.1.0-beta1',
     '1.0.0-rc' ],
  maintainers:
   [ 'alex.fedoseev <alex.fedoseev@gmail.com>',
     'shakacode <justin@shakacode.com>' ],
  time:
   { modified: '2015-12-11T16:53:04.622Z',
     created: '2015-11-11T04:18:27.648Z',
     '0.0.1': '2015-11-11T04:18:27.648Z',
     '0.0.2': '2015-11-13T21:42:01.200Z',
     '0.0.3': '2015-11-14T16:34:29.354Z',
     '0.0.4': '2015-11-15T11:51:10.296Z',
     '0.0.5': '2015-11-16T16:34:46.825Z',
     '0.1.0-beta1': '2015-12-07T21:26:12.541Z',
     '1.0.0-rc': '2015-12-11T16:53:04.622Z' },
  homepage: 'https://github.com/shakacode/bootstrap-loader#readme',
  keywords: [ 'bootstrap', 'twitter' ],
  repository:
   { type: 'git',
     url: 'git+https://github.com/shakacode/bootstrap-loader.git' },
  bugs: { url: 'https://github.com/shakacode/bootstrap-loader/issues' },
  license: 'MIT',
  readmeFilename: 'README.md',
  version: '1.0.0-rc',
  main: 'loader.js',
  scripts:
   { start: 'npm run lint && npm run clean && npm run dev',
     dev: 'scripts/dev',
     build: 'scripts/build',
     lint: 'scripts/lint',
     clean: 'scripts/clean',
     prerelease: 'npm run lint && npm run clean && npm run build',
     'release:patch': 'scripts/release patch',
     'release:minor': 'scripts/release minor',
     'release:major': 'scripts/release major' },
  authors:
   [ 'Justin Gordon <justin.gordon@gmail.com> (https://github.com/justin808)',
     'Alex Fedoseev <alex.fedoseev@gmail.com> (https://github.com/alexfedoseev)' ],
  peerDependencies:
   { 'css-loader': '*',
     'node-sass': '*',
     'resolve-url-loader': '*',
     'sass-loader': '*',
     webpack: '*' },
  dependencies:
   { chalk: '^1.1.1',
     'escape-regexp': '0.0.1',
     'js-yaml': '^3.4.3',
     'loader-utils': '^0.2.11',
     resolve: '^1.1.6',
     semver: '^5.0.3',
     'strip-json-comments': '^1.0.4' },
  devDependencies:
   { babel: '^6.0.15',
     'babel-cli': '^6.1.4',
     'babel-preset-es2015': '^6.1.4',
     eslint: '^1.10.3',
     'eslint-config-airbnb': '^2.0.0' },
  gitHead: '5276146db399d74d8819c4a1a31b289443ed703d',
  dist:
   { shasum: 'c984f1b1d26a461d3fac55edcd56754743e4edf4',
     tarball: 'http://registry.npmjs.org/bootstrap-loader/-/bootstrap-loader-1.0.0-rc.tgz' },
  directories: {} }

@jeffhertzler
Copy link

adding @latest gives me 1.0.0-rc but not specifying any version still gives me 0.0.5

@justin808
Copy link
Member

@jeffhertzler did that fix the issue?

@jeffhertzler
Copy link

Using 1.0.0-rc fixed the windows issue, yes.

I still receive 0.0.5 by default when installing bootstrap-loader without specifying a specific version or latest though. Cleared npm cache and tried to install into a fresh project that's basically an empty package.json.

@alex35mil
Copy link
Member

@simkessy Please confirm that after upgrade to 1.0.0-rc issue is fixed. If it's not — reopen this issue and post debug info (see my comment above).

@jeffhertzler I guess I had similar issue with React Router's RC and as far as I remember different versions of npm handles pre-releases differently. Anyway we will release 1.0.0 today, so it should solve default install issue.

@jeffhertzler
Copy link

Thanks!

@simkessy
Copy link
Author

I just checked and I was using version 0.0.5.

1.0.0.-rc works fine. thanks

@alex35mil
Copy link
Member

Awesome 👍

@ericdfields
Copy link

I'm seeing the same error:

Error:

ERROR in ../~/css-loader!../~/resolve-url-loader!../~/sass-loader?sourceMap!../~/bootstrap-loader/lib/bootstrap.styles.loader.js!../~/bootstrap-loader/no-op.js
Module build failed: 

^
      File to import not found or unreadable: ../../app/styles/bootstrap/pre-customizations.scss
Parent style sheet: stdin
      in /Users/EricFields/Development/vanda/node_modules/bootstrap-loader/no-op.js (line 2, column 1)
 @ ../~/style-loader!../~/css-loader!../~/resolve-url-loader!../~/sass-loader?sourceMap!../~/bootstrap-loader/lib/bootstrap.styles.loader.js!../~/bootstrap-loader/no-op.js 4:14-424

I'm using it in my webpack config as part of an array of entries: entry: ['bootstrap-loader'…],

I also have context: __dirname set, if that matters.

@justin808
Copy link
Member

@ericdfields We'll need some more help from you to debug your issue.

@ericdfields
Copy link

I will isolate the case and follow up!

On Mar 22, 2016, at 13:45, Justin Gordon notifications@github.com wrote:

@ericdfields We'll need some more help from you to debug your issue.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@ericdfields
Copy link

Alright, here's the webpack conf I'm working with:

var path = require("path")
var webpack = require("webpack");

var dirJs = path.join(__dirname,'javascripts')

module.exports = {
  context: __dirname,
  entry: {
    vendor: [
      'react',
      'react-dom',
      'react-addons-update',
      'react-addons-css-transition-group',
      'jquery',
      'bootstrap-loader'
    ],
    '_application': path.join(dirJs,'./global.js')
  },
  output: {
    path: '../app/assets/javascripts/webpack',
    filename: '[name].bundle.js'
  },
  module: {
    loaders: [
      {
        loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
        test: /\.s?css$/
      },
      { test: require.resolve("jquery"), loader: "expose?jQuery" },
      { test: require.resolve("jquery"), loader: "expose?$" }
    ]
  },
  plugins: [
    new webpack.ProvidePlugin({
      $:      "jquery",
      jQuery: "jquery"
    }),
    new webpack.optimize.CommonsChunkPlugin(/* chunkName= */"vendor", /* filename= */"vendor.bundle.js"),
    new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/)
  ],
  resolve: {
    root: [dirJs]
  }
}

My directory structure is

  • /
    • .bootstraprc
    • package.json
    • node_modules/
    • frontend/
      • webpack.dev.config.js

In package.json, I have a script 'dev': "dev": "cd frontend && webpack -w --config webpack.dev.config.js",

I'm guessing the fact that the webpack config is one dir below node_modules has something to do with it?

In order to read .bootstraprc properly, it seems that I have to have it in the root directory alongside package.json and node_modules

@ericdfields
Copy link

@justin808 btw thanks for all your rails on maui work. That was my foothold into working with webpack alongside a rails environment!

@ericdfields
Copy link

nvm, got it. I used the bootstraprc out of one of the examples and it it made reference to a file path I don't use. thanks for the consideration.

@justin808
Copy link
Member

@ericdfields You're welcome!

@ashugit
Copy link

ashugit commented Apr 4, 2017

@ericfields just to mention, did the same mistake and took some time to correct it. Thanks for your closure comment though.

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

No branches or pull requests

8 participants