Closed mariusstaicu closed 7 years ago
I have the same problem. Differences are:
node: v6.9.4
npm: 3.10.10
yo: 1.8.5
Linux ubuntu 14.04 LTS, linux 3.19.0-79-generic x86_64
What I noted is that during the yo generate, I get unresolved dependencies:
UNMET PEER DEPENDENCY zone.js@0.6.26 UNMET PEER DEPENDENCY webpack@2.1.0-beta.27 UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12 UNMET PEER DEPENDENCY babel-core@^6.0.0
upgraded to webpack 2.2.1 in package.json and it works ok
@mariusstaicu thanks for the tip! Upgrading to Webpack 2.2.1 allows my builds to succeed.
The UNMET PEER DEPENDENCY
issue still persists and, while I'm assuming this is caused by a dependency being updated, I'm unable to decipher which one is responsible.
there seem to be some issues with resolving dependencies, however webpack is downloaded in node_modules and gulp build works after that.
I am ok with this workaround as long as it allows me to move on with this issue.
@mariusstaicu it appears this change has broken Karma's ability to find/load Webpack. Is this also the case for you?
yes, indeed, it's the same, noticed just now
I had the same problem with the CSS files and it seems that it's related to this issue in webpack.
I didn't update the webpack version. Instead I edited a few lines in webpack.dist.conf.js
:
I replaced this
test: /\.css$/,
loaders: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader?minimize!postcss-loader'
})
with this
test: /\.css$/,
loaders: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader'
})
Now both build
and test
work.
@TKasekamp thanks for the additional info. Based on that, I was able to get things running properly (without changing webpack.dist.conf.js
) by updating the following dependencies to these versions:
"css-loader": "^0.26.1",
"karma-webpack": "^2.0.2",
"webpack": "2.2.1",
If you try these module versions could you please confirm whether they work or not on your system?
If anyone can point me in the right direction to fix these version inclusions I'd be happy to make a PR.
@mikeymco I reverted the webpack.dist.conf.js
to it's original versions and updated the dependencies to the ones you provided. I still get the build error, so this isn't a fix for me.
My system
win32 10.0.10586
node v6.7.0
npm v3.10.3
yo 1.8.5
I resolved this using the last version for any webpack package in the package.json Just remove the ^ in the webpack dependency version and try.
The fix below also solves this issue. It does the same thing as the original code.
{
test: /\.css$/,
loaders: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: [{
loader: 'css-loader',
options: {
minimize: true
}
}, {
loader: 'postcss-loader'
}]
})
},
Thanks for the suggestions. they all seem to work. I preferred to go with updating package.json versions for css-loader, karma-webpack and html-webpack-plugin to latest.
I updated all the npm packages using npm-check-updates and it worked like a charm right after.
I used the commands -
npm-check-updates
to check all the packages that need updating.
then I ran npm-check-updates -u
to update all the versions in your package.json (this is the magic sauce)
npm update
as usual to install the new versions of your packages based on the updated package.json.
After upgrading to Webpack 2.2.1 and doing what @sanathbits suggested, I'm getting:
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'debug'. The 'debug' property was removed in webpack 2.
Couldn't locate the source of the problem yet.
Migrating from v1 to v2 https://webpack.js.org/guides/migrating/ my develop config:
const webpack = require('webpack'); const conf = require('./gulp.conf'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const FailPlugin = require('webpack-fail-plugin'); const autoprefixer = require('autoprefixer');
module.exports = {
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre'
},
{
test: /.css$/,
use: [
'style-loader',
'css-loader',
'postcss-loader'
]
},
{
test: /.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader',
'postcss-loader'
]
},
{
test: /.js$/,
exclude: /node_modules/,
use: [
'ng-annotate-loader',
'babel-loader'
]
},
{
test: /.html$/,
use: [
'html-loader'
]
},
{
test: /.(jpg|png)$/,
loader: "file-loader"
},
{
test: /.(ttf|eot|svg)(\?v=[0-9].[0-9].[0-9])?$/,
loader: "file-loader"
},
{
test: /.woff(2)?(\?v=[0-9].[0-9].[0-9])?$/,
loader: "url-loader?limit=10000&mimetype=application/font-woff"
}
]
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
//new webpack.NoErrorsPlugin(),
//FailPlugin,
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
}),
new webpack.LoaderOptionsPlugin({
options: {
postcss: () => [autoprefixer]
},
debug: true
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"window.$": "jquery"
})
],
devtool: 'source-map',
output: {
path: path.join(process.cwd(), conf.paths.tmp),
filename: 'index.js'
},
entry: ./${conf.path.src('index')}
};
After 1.0.0 released, everything is working perfectly now. Thank FountainJS team 👍
Cool! Thanks for the feedback! 🎉 🎉
Description
After installing latest version of generator using yo and running gulp, build fails (see below).
Error Message & Stack Trace
Config
Copy the content from
.yo-rc.json
:Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly: