gowravshekar / font-awesome-webpack

font-awesome package for webpack
MIT License
192 stars 49 forks source link

Doesn't work with Webpack 2 #24

Closed unyo closed 7 years ago

unyo commented 8 years ago

Currently getting the following error using Webpack 2:

Uncaught Error: Cannot find module "style!css!less!./font-awesome-styles!./font-awesome.config.js"

Module not found: Error: Can't resolve './font-awesome-styles' in '/Users/unyo/ocean/node_modules/font-awesome-webpack' resolve './font-awesome-styles' in '/Users/unyo/ocean/node_modules/font-awesome-webpack'

unyo commented 8 years ago

I wonder how you link issues (sorry first pull request) https://github.com/gowravshekar/font-awesome-webpack/pull/25

ericmdantas commented 8 years ago

Yup, same problem here.

tamasd commented 8 years ago

I have the same problem as well.

banacorn commented 7 years ago

+1

tamasd commented 7 years ago

I created a temporary fork until this issue gets resolved: https://www.npmjs.com/package/font-awesome-webpack2

hwupu commented 7 years ago

@tamasd bravo!

Ugarz commented 7 years ago

Hey @tamasd thanks dude 🍻 !

unsafecode commented 7 years ago

@tamasd Is there a specific reason to use the less version? I came across an annoying issue when using npm shrinkwrap, which was caused by less and less-loader.

tamasd commented 7 years ago

@unsafecode in my fork I only merged a very small PR that makes it work with the newer webpack versions. Your issue is present in the original package as well.

Achieve777 commented 7 years ago

@tamasd Can't resolve 'font-awesome/less/stacked.less

aelkz commented 7 years ago

Same error for me.. Can't find a solution!

Error: Cannot find module 'style-loader!css-loader!less-loader!./font-awesome-styles.loader!./font-awesome.config.js' from ...

my dependencies in package.json:

"dependencies": { "bulma": "^0.3.1", "css": "^2.2.1", "css-loader": "^0.25.0", "file-loader": "^0.9.0", "font-awesome": "^4.7.0", "font-awesome-webpack2": "0.0.6", "less": "^2.7.2", "less-loader": "^2.2.3", "style-loader": "^0.13.1", "sweetalert": "^1.1.3", "url-loader": "^0.5.7", "vue": "^2.1.0", "vue-resource": "^1.0.3" },

and require('font-awesome-webpack2') in main.js file.

simonh1000 commented 7 years ago

I'm experiencing the same problem. I add

      { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
      { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }

to webpack.config.js and added require("font-awesome-webpack2"); to index.js. That results in

ERROR in Cannot find module 'less'
 @ ./~/font-awesome-webpack/~/style-loader!./~/font-awesome-webpack/~/css-loader!./~/less-loader!./~/font-awesome-webpack/font-awesome-styles.loader.js!./~/font-awesome-webpack/font-awesome.config.js 4:14-144 13:2-17:4 14:20-150

I do not have less installed.

What is the way forward?

danii1 commented 7 years ago

@tamasd have you figured out how to use extract-text-webpack-plugin with your fork and webpack 2? It works with styleLoader: 'style-loader!css-loader!less-loader', but haven't figured how to make extract-text work, either errors or all fa-* styles end up in js...

wolfadex commented 7 years ago

This should be resolved by #23 which is now merged. I will close this after a #23 has been released.

wolfadex commented 7 years ago

@tamasd would you like to merge your fork back in?

tamasd commented 7 years ago

No, afaik there's nothing in important in it anymore.

wolfadex commented 7 years ago

I'm closing this issue as it does work with webpack2 now. If anyone has any outstanding issues in this ticket, please open them as new separate issues.

winnemucca commented 7 years ago

@wolfadex I am still getting the exact same errors. Do you have a repository that shows this working? I have been working on this following the npm instructions for over an hour now.

https://www.npmjs.com/package/font-awesome-sass-loader

arpowers commented 7 years ago

the bug is that they have forgotten to add the original 'font awesome' npm as a dependency

realfresh commented 7 years ago

If your missing stacked.less or other files, npm install font-awesome. As the poster above said, its missing font-awesome as a dependency. Same with anything else, if your missing "less" or "url-loader" or whatever, just install --save-dev it

yavir-me commented 6 years ago

npm i --save font-awesome should resolve your problems. Regards, Andrey.