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

WARNING in ./~/jade/lib/runtime.js Module not found: Error: Cannot resolve module 'fs' in /home/some/path/node_modules/jade/lib #451

Closed
11111000000 opened this issue Sep 4, 2014 · 11 comments

Comments

@11111000000
Copy link

var webpack = require('webpack');

module.exports = {
  entry: [
    "webpack-dev-server/client?http://localhost:8080" 
    , "webpack/hot/dev-server"
    , __dirname + "/client/index.ls"
  ]
  , plugins: [
    // new ComponentPlugin()
    (new webpack.HotModuleReplacementPlugin())
  ]
  , output: { 
    path: __dirname + "/public"
    , filename: "bundle.js"
    , publicPath: "/"
  }  
  , module: {
    loaders: [
      { test: /\.css$/,  loader: "style!css" }
      , { test: /\.styl$/,  loader: "style!css!stylus?paths=node_modules/" }
      , { test: /\.html$/,  loader: "html" }
      , { test: /\.jade$/,  loader: "jade" }
      , { test: /\.json$/,  loader: "json" }
      , { test: /\.ls$/,   loader: "livescript" }
      , { test: /\.woff$/, loader: "url-loader?limit=10000&minetype=application/font-woff" }
      , { test: /\.ttf$/,  loader: "file-loader" }
      , { test: /\.eot$/,  loader: "file-loader" }
      , { test: /\.svg$/,  loader: "file-loader" }
      , { test: /\.png$/,  loader: "file-loader" }
    ]
  }

}
@11111000000 11111000000 changed the title WARNING in ./~/jade/lib/runtime.js Module not found: Error: Cannot resolve module 'fs' in /home/az/work/Pmeter/node_modules/jade/lib WARNING in ./~/jade/lib/runtime.js Module not found: Error: Cannot resolve module 'fs' in /home/some/path/node_modules/jade/lib Sep 4, 2014
@11111000000
Copy link
Author

same, when I use webpack without hot module replacement

@jhnns
Copy link
Member

jhnns commented Sep 4, 2014

The fs-module is not available in the browser (for obvious reasons). You probably want to compile your jade-templates: use the jade-loader for that.

@11111000000
Copy link
Author

Yes, and there is jade-loader used, or I don't know something?

@sokra
Copy link
Member

sokra commented Sep 4, 2014

pugjs/pug#1644

@sokra
Copy link
Member

sokra commented Sep 4, 2014

As workaround add this to your config:

node: {
  fs: "empty"
}

@11111000000
Copy link
Author

thank you!

@mllocs
Copy link

mllocs commented Sep 15, 2014

+1

@khoerling
Copy link

+2!

@codeboyim
Copy link

I got the same problem when using showdownjs. setting {fs:'null'} in externals solved for me.

@MoOx
Copy link
Contributor

MoOx commented Dec 5, 2014

Getting the same fs issue. browserify can build test run with tape, webpack can't :/

@shama
Copy link
Member

shama commented Jul 19, 2015

Closing as this issue appears to be resolved seeing jade ignoring fs in browser builds: pugjs/pug#1644 Please reopen if this issue has not been resolved. Thanks!

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