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
Should export ES5-compatible for npm, otherwise babel transform is required externally #139
Comments
Just use the previous version for now. They are the same. |
@hueniverse yes, I do this for now. |
i ran into this issue while updating my dependencies and saw the latest was 6.0.0 ... unfortunately this caused me to see the error |
I suggest you learn how semver works and don't upgrade to a new major version without understanding what broke. |
@hueniverse i am aware of how semver works, thank you. thought you might want to know that there's more than one person that would like to use |
You can also add the path to qs in your array of included files for the babel transformer. Then you could exclude all of the other node_modules, but include qs. |
how would one do that actually? If |
When you are setting up the loader, if you are excluding "node_modules", there is also an module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
include: [
'path/to/your/app',
'node_modules/qs'
]
loader: 'babel',
query: {
presets: ['es2015']
}
}
]
} Something along those lines. You'll have to play around with the include paths but that is the general gist of it. |
There are certainly workarounds but this does not actually resolve the
issue.
|
There is no way to resolve this because there is no issue. This module is ES6 now. If you need ES5, either use an older version or configure your transpiler to deal with it for you. |
I'm aware of the many methods available for maintaining an ES5 version of this module. I have no interest in doing so. If you really want an ES5 version, build and publish one. I'm happy to link to it from here. |
I see. Good luck then.
|
@arb that was my exact point: if a path is in
It won't. |
Come on, it's a regex, It's not that hard to exclude I stand with @nlf, it's your problem if you want to take it into an ES5-only environment, this module explicitly says it uses node 4+ and YOU have ways to deal with it. |
I'd like to state that in some cases "configure your transpiler to deal with it for you" is actually a ridiculous suggestion. I'm using browserify, but:
|
It seems to me that as this is an official hapi module there should be an official hapi policy in place for module dependencies. My vote is make it work for the widest possible audience, out of the box and with least effort. At least until ES5 is way down the long tail. |
we have a discussion along those lines going here |
Had the same problem & spent more time researching it than it took to fix it with webpack: module: {
loaders: [
{
exclude: /node_modules/,
loader: "babel-loader",
test: /\.js$/,
},
{
include: /node_modules\/qs/),
loader: "babel-loader",
test: /\.js$/,
},
],
}
} Happy copy-pasting! |
I think you could also replace |
The ES2015-rewritten 6.0.0 has issues when using via webpack. Usually, babel transform is only applied to the app code, and the
node_modules
directory is excluded entirely. This does not work with 6.0.0 compared to ES5-compatible 5.2.0 -- webpack bundles the ES2015 code of thenode_modules/qs
right into the output, which then breaks the uglify step.Please provide ES5-compatible build without browserify and point
package.json
'smain
to it.This can be done in the
prepublish
step. Look how it's implemented.Related: #128, #129, #108.
The text was updated successfully, but these errors were encountered: