-
Notifications
You must be signed in to change notification settings - Fork 19
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
Error in webpack Build #35
Comments
Hey @vivekgs2007! Thanks for reporting this issue. Would you be so kind and provide us with the following information?
|
Here is a part webpack conf file where all the modernizrrc configuration is added:
Here is modernizrrc file and saved has ".modernizrrc"
|
Ok, if you're using webpack 2 I think you always have to provide I'm not sure if you want this, but here you are not escaping the dot (which you have to, if you only want to match the regex on a You may have some misconfiguration (there are a load of tests which apply to either
and try if that helps? |
Tried with above and other possible ways, But No Luck. Here are the Loaders
In the entry js file I have included
Error on Build:
|
Could you provide a small sample repository? I'm not sure if this is related to to the |
You are requiring the modernizr module. You should require your |
@jhnns I have changed the mine .modernizrrc to .modernizrrc.js But Still no luck
Let me know any other way. Does this plugin is compatible with webpack 2 |
Tried requiring the .modernizrrc.js in entry file, No Luck |
@vivekgs2007 do you think you can set up a small example repository which reproduces your error? I think this would be helpful so that we can finally solve your problem :) |
I tried other plugins "modernizr-webpack-plugin" and "webpack-modernizr-loader" Got the same errors. Need to find the other solution. |
Yeah, I think you might have some misconfiguration with your webpack config. If you could set up a sample project which reproduces the error, we can help you. Otherwise it would be like trying to find a needle in a haystack, unfortunately |
So I had the same issue with webpack 2. Instead of aliasing the .modernizrrc file, I required it directly (require('../../../.modernizrrc') and it worked. It looks like the issue is with it being able to resolve the aliased modernizrrc and load it properly... Not entirely sure why. |
@vivekgs2007 could you resolve your issue with @rhagigi suggestion? |
I had to change this to the following to get it working:
|
I am struggling with the same problem though still not managed to get it working. @mikeyalder-bw, please can you confirm how you are loading modernizr in your scripts? Is it with |
I am requiring it using code below:
|
Thanks. That helped me realise my mistake. My file structure is slightly different and I needed to set my alias as follows:
|
Incidentally. Both of these seem to work for me:
and
All is now working as it should. |
I'm having the same issues, I'm using the configuration as mentioned in the readme of My console outputs:
I've attached a minimal reproduction sample, any guidance into what I'm missing ? Repro steps:
|
You have a different modernizrrc test to me. You could try changing:
to…
Also try removing resolveLoader and add your alias to the resolve object instead:
|
@trafiq I've must have missed something, it appears to work. Thanks! 👍 Note, the sample I added seems to miss the
Making these changes does succeed the build, however Modernizr logs undefined in the browser.
Anything I'm missing here ? I've reattached the reproduction sample, which should not be missing dependencies this time 🙈 . You can run |
@flootr, sorry for mentioning u directly. Any idea why it's giving me undefined ? I did some debugging inside modernirz-loader:
Results in
This is also available in my bundle.js file ... So this would make me think that:
|
Apparantly I need to use |
I used a modernizr-config.json file for config, like advised for for the cli. module.exports = {
...
module: {
rules: [
{
test: /modernizr-config(\.json)?$/,
use: [
{
loader: 'modernizr-loader',
options: require('./conf/modernizr-config.json'),
},
{
loader: 'json-loader',
},
]
},
]
},
resolve: {
alias: {
modernizr$: path.resolve(__dirname, 'conf/modernizr-config.json')
}
},
}; ( |
@stephane-tessier's solution worked for Webpack3 as well |
For anyone struggling to get this working on Rails 6 -- I did the following:
|
I am followed the steps as per the readme file and Got the same issue as the issue-5 ( #5 )
As mentioned by @flootr, I have updated the code but No Luck
Webpack: v2.1.0-beta.20
Let me know if you need any more information
The text was updated successfully, but these errors were encountered: