Open benduran opened 8 years ago
And go figure, as soon as I post this, I figure out the problem.
@benduran what was the issue? Having the same problem here.
@piersadrian For me, it's a problem that is harder to correct. My build is heavily reliant on CLI arguments, which is something mocha doesn't handle out of the box (meaning pass-through). My webpack.config wasn't being transformed correctly because of this.
Hi! If this is a problem, use v1.9.0 until I fix that. I released this one as a major release so that npm doesn't auto install this version for people having "^1.9.0" in their package.json.
I'll look into that as soon as I can.
I can't really reproduce that, @piersadrian can you give me more info about your dev environment and configuration? Thanks!
@piersadrian are you using v2.0.0
? This issue was occurring with v1.8.3
but I thought I fixed it in v2.0.0
.
I can't replicate the issue at the moment and I can't investigate without more information, so I will close that for now, feel free to comment if you can provide more info.
+1 having the same issue, .babelrc:
{
"presets": ["react", "es2015", "stage-1", "stage-0"],
"plugins": [
"react-hot-loader/babel",
[
"babel-plugin-webpack-alias",
{
"config": "webpack.config.dev.js",
"findConfig": true
}
]
]
}
webpack.config.dev.js:
const path = require('path');
const webpack = require('webpack');
module.exports = {
// ...
resolve: {
modulesDirectories: ['node_modules', 'client', 'components', 'stores'],
extensions: ['', '.js', '.scss', 'svg', 'ttf', 'woff', 'eot'],
root: [path.join(__dirname, './client')],
alias: {
assets: path.resolve(__dirname, './client/assets'),
stylesheets: path.resolve(__dirname, './client/stylesheets'),
client: path.resolve(__dirname, './client'),
components: path.resolve(__dirname, './client/components'),
actions: path.resolve(__dirname, './client/actions'),
reducers: path.resolve(__dirname, './client/reducers'),
},
},
};
EDIT: To anyone having this problem: try using path.join() instead of path.resolve(). I think that's what causing it.
@savovs Thanks for pointing this out. I ended up running into this issue again yesterday when setting up a new test project. Rolling back to 1.8.2
fixed the issue for me, though that version is quite old now.
I'll upgrade back to the current version and try swapping over to path.join
and report my findings
@benduran @savovs don't worry about using v1.8.2
, the library hasn't changed much since then. I'll have a look at that as soon as I can.
+1
Having the same issue, with similar configuration, on version 2.1.1
. Rolling back to 2.1.0
works for me.
Thanks for the feedback, at the moment the only way to fix this seems to rollback to 1.8.2
.
I don't have time to work on this for now. Can anyone make a small repo which replicates this issue?
@McChen have you tried changing path.resolve()
s to path.join()
s in your webpack config? That fixed the issue for me.
@savovs I was using path.join()
to begin with actually. 2.1.0
but had to rollback all the way to 1.8.2
on Jenkins.
yep, 1.8.2 works like a charm.
@pawelrychlik I am trying this with 1.8.2 but it is not working are you using path.join
or path.resolve
@kwelch path.join
does the job for me. A snippet from my webpack config:
alias: {
'config': path.join(__dirname, './config/index.js'),
},
And I'm explicitly using exactly "1.8.2"
in package.js, with no ^
or ~
.
I've seen this issue in a closed github issue, but I just installed
v2.0.0
of this plugin and received the same issue. Here are my configs for reference:Webpack.config
package.json babel config
Error, for reference