Comments (3)
Hi @ghostsquad, I don't know this secret. Just add next line to your entry. And configure webpack: add style-loader + css-loader (+ sass-loader, if you use SASS or similar preprocessor like Less). Does it solve your issue? In which part of your app you probably have a bug?
from suicrux.
Here's the full error:
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/images/flags.png' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:118857-118908
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/fonts/icons.eot' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:154624-154674 6:154697-154747
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/fonts/icons.woff2' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:154797-154849
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/fonts/icons.woff' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:154880-154931
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/fonts/icons.ttf' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:154961-155011
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
ERROR in ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css
Module not found: Error: Can't resolve './themes/default/assets/fonts/icons.svg' in '/Users/wes/projects/react-dashboard/node_modules/semantic-ui-css'
@ ./node_modules/css-loader!./node_modules/semantic-ui-css/semantic.css 6:155045-155095
@ ./node_modules/semantic-ui-css/semantic.css
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill ./src/index.js
My webpack config looks like this:
const isProduction = process.env.NODE_ENV === 'production';
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const DashboardPlugin = require('webpack-dashboard/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const modulesDirectory = path.resolve(__dirname, 'node_modules');
const sourceDirectory = path.resolve(__dirname, 'src');
const staticDirectory = path.resolve(__dirname, 'static');
const distDirectory = path.resolve(__dirname, 'dist');
// -------------------------------------------------------------------------- //
module.exports = {
entry: [
'babel-polyfill',
path.resolve(sourceDirectory, 'index.js')
],
output: {
path: distDirectory,
filename: 'index.js',
publicPath: '/'
},
devtool: 'source-map', // any "source-map"-like devtool is possible
devServer: {
historyApiFallback: true,
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
enforce: 'pre',
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true
}
},
{
loader: 'eslint-loader'
}
],
},
{
test: /\.(ico|eot|otf|webp|ttf|woff2?|gif|png|jpe?g|svg)$/i,
use: [
{
loader: 'file-loader',
options: {
limit: 100000,
name: 'assets/[name].[sha1:hash:base64:8].[ext]'
}
}
]
},
{
test: /\.css$/,
include: /node_modules/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader',
}
]
},
{
test: /\.css$/,
exclude: /node_modules/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader',
options: {
sourceMap: true,
modules: true
}
},
{
loader: 'postcss-loader',
options: {
sourceMap: true
}
},
{
loader: 'resolve-url-loader'
}
]
}
]
},
resolve: {
extensions: ['.js', '.jsx', '.json', '.css', '.jpeg', '.jpg', '.png', '.gif', '.svg'],
alias: {
'_': sourceDirectory,
'react': 'preact-compat',
'react-dom': 'preact-compat'
},
modules: [
sourceDirectory,
modulesDirectory
]
},
plugins: [
new DashboardPlugin(),
new CopyWebpackPlugin([
{
from: staticDirectory,
to: distDirectory
}
]),
new HtmlWebpackPlugin({
title: 'React Dashboard',
filename: path.resolve(distDirectory, 'index.html')
}),
new ManifestPlugin()
]
};
I'm almost to the point where I just want to vendor in the necessary themes and icons/fonts straight from semantic-ui source
from suicrux.
@ghostsquad I think it would be better if you modify your current project's webpack config to a similar config in the starter. It would be easier to debug (from my point of view) + probably your issue disappear after that. I faced similar issue when I was working on vue-element-starter, but it was resolved after resolve-url-loader was added.
from suicrux.
Related Issues (20)
- Stuck at Login `auth` screen HOT 2
- NextJS integration HOT 9
- Basic Setup ? HOT 1
- The script has an unsupported MIME type ('text/html'). HOT 2
- Source Map Issue HOT 2
- sidebaritem titles are shown on header when page is refreshed HOT 6
- Deploying application with apache, frontend does not show... HOT 5
- Who's using Suicrux? HOT 9
- Roadmap [WIP]
- Eager to see Redux-Saga in this project HOT 1
- flow-typed install fails HOT 1
- Error Can't resolve 'react-tree-walker', while running "npm run dev" from master branch HOT 2
- Version 10 of node.js has been released
- static only? HOT 1
- Unable to debug in VSCode editor HOT 1
- An in-range update of webpack-hot-middleware is breaking the build 🚨 HOT 3
- An in-range update of babel-plugin-styled-components is breaking the build 🚨 HOT 1
- An in-range update of react is breaking the build 🚨 HOT 31
- An in-range update of enzyme is breaking the build 🚨
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suicrux.