You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IE11 fails to load with Invalid character error #1268
I have the same issue using Firefox 38.4.0: injected client code is not transpiled to es5.
As a result firefox complains that let is a reserved keyword.
The faulty injected code resides in client/index.js.
I'm new to webpack and have not grasped its internals yet but there seems to be already some rules in client/webpack.config.js that handles this file and the transpiled file (index.bundle.js) is laying in the node_module/webpack-dev-server/client but this is not the file that is injected in my entry point.
I don't know what to do to fix and would appreciate any help...
@sebtoun that browser version is nearly 3 years old!. while the changes that @yyx990803 made in his PR should in theory support that browser... good lord download an update!
My previous comment contains the solution. Webpack needs to be told how to compile the client entries automatically added to the config. If I had more time I'd walk you through it. Big life change coming up so I'm crazy short on it right now.
Reacted by Kevin, Lukasz D, Jakub Homoly, Ritchie Martori, Stefan Norberg, Frank An, Botond Balázs, Jeremy Lucas, Sentient Drone, Cristobal and 9 more
My client company has a very restrictive work environment upgrade policies, I have to support that exact firefox version. It is thus safer for me to develop on the exact same environment and not having livereload really bothers me. I use webpack-dev-server v2.7.1 in the meantime but will upgrade to latest when this is fixed.
Despite your comment, I still don't get why node_module/webpack-dev-server contains both client/index.js and client/index.bundle.js (As far as I understand, those are the same code : the source version and the transpiled version) and I can't find where the client/index.js version is used and why it is used in this version (not the transpiled one). Again, I don't really grasp how webpack-dev-server is working in its entirety.
client/index.bundle.js is for folks that use inline: false and such. There are examples demonstrating that in the repo. If you search for "index.bundle.js" at the top, in this repo, you'll find the examples that use it.
Why not using client/index.bundle.js instead of client/index.js when using inline: true ? Aren't those two versions the same code before and after transpilation|minification ?
Shipping babel-core + babel-loader + babel-preset-env as dependencies of webpack-dev-server is definitely worse than just importing the pre-built bundle.
Reacted by Sebtoun, Billy Janitsch, Victor Glindås, Sentient Drone, Orlandster and Park Hee Chan
What are the downsides of including a bundle in a bundle? If webpack can handle that properly, then the only issue is it being "bad practice", which does not affect the user in anyway.
On the other hand, including the whole babel suite as dependencies means you are shipping ~30Mb of extra payload if the user doesn't use babel, or uses an incompatible version of babel. This amounts to wasted bandwidth cost and installation time, and it compounds during CI jobs. This is a much more practical problem than having a bundle in a bundle.
Reacted by Sebtoun, Billy Janitsch, Sentient Drone and Orlandster
@yyx990803 honestly guy. you pushed for your changes. the team caved to them. your changes broke a ton of implementations. I gave you the entirely reasonable fix I want to see (in multiple places) and now you're gonna push back against that.
You carry a lot of weight in the community due to Vue. I get it. But I'm done. Perhaps someone more amicable to your way will pick up maintenance of the project. ✌ out.
Reacted by Sebtoun, Philipp Spiess, Victor Glindås, Frank An, Andrew Kos, Jives, Kieran Benton and Daniel Beck
@shellscape I don't get your aggressiveness in all of this - I know you might have life stress, but as a maintainer myself I just have different perspectives on how the tradeoffs should be weighed. I tried to figure out a better solution after the first PR was rejected. I didn't even get a chance to defend the 2nd PR before you locked it. I simply disagree with your proposed solution of including babel as direct dependencies, for the reasons I outlined above. We are all just trying to find reasonable solutions to fix the problem for the users, and sometimes that means we may disagree on how that should be done, but that doesn't mean it's ok to just give in to your emotions instead of debating the actual problems. If you are busy with your life, maybe it is indeed time you take a break and let someone else take care of this project.
Reacted by Billy Janitsch, Marvin, Frank An, Jeremy Lucas, Andrew Kos, Sentient Drone, Martin Patino, Peter Zheng, Trevor Blades, Orlandster and 1 more
The problem is more general than that line and IE11, it is an incompatibility between the whole client code (written with es6) and browsers that do not support all es6 features used.
That's true, but if you don't want to transpile your code with heavy weight tools, why not just keep then the code in es5?
This problem was introduced in v2.8.0 and fixed afterwards, but by some reason it was decided to break it again from the version v2.10.0.
From my point of you, the complains are quite reasonable. The current decision of introducing that problem just holding from updating to the latest version. Or forces to create yet another 600+ fork to fix that issue for ones who have a product with customers using IE.
@acierto my 1st PR was converting all the client code back to ES5, but it was rejected likely because the maintainers didn't want to have to write ES5 only in one part of the codebase.
The break in 2.10 wasn't intentional, it was a regression introduced by my 2nd PR which attempted to transpile the client-side code with babel, so that all client source code can remain ES2015. However the bundling setup was actually used only in live mode and caused CLI inline mode to use the raw ES2015 files.
Activity
shellscape commentedon Jan 9, 2018
@creage thanks for the report. this is a great opportunity for a first pull request. We'd happily review one.
shellscape commentedon Jan 9, 2018
It would seem that #1242 introduced an incomplete compilation using babel. Rules need to be injected into the config around here https://github.com/webpack/webpack-dev-server/blob/master/lib/util/addDevServerEntrypoints.js#L20 to compile the client scripts in the bundle. Something like:
That also means that the babel dependencies need to be moved to
dependenciesrather than devDeps.sebtoun commentedon Jan 9, 2018
I have the same issue using Firefox 38.4.0: injected client code is not transpiled to es5.
As a result firefox complains that
letis a reserved keyword.The faulty injected code resides in
client/index.js.I'm new to webpack and have not grasped its internals yet but there seems to be already some rules in
client/webpack.config.jsthat handles this file and the transpiled file (index.bundle.js) is laying in thenode_module/webpack-dev-server/clientbut this is not the file that is injected in my entry point.I don't know what to do to fix and would appreciate any help...
shellscape commentedon Jan 9, 2018
@sebtoun that browser version is nearly 3 years old!. while the changes that @yyx990803 made in his PR should in theory support that browser... good lord download an update!
My previous comment contains the solution. Webpack needs to be told how to compile the client entries automatically added to the config. If I had more time I'd walk you through it. Big life change coming up so I'm crazy short on it right now.
sebtoun commentedon Jan 9, 2018
My client company has a very restrictive work environment upgrade policies, I have to support that exact firefox version. It is thus safer for me to develop on the exact same environment and not having livereload really bothers me. I use webpack-dev-server v2.7.1 in the meantime but will upgrade to latest when this is fixed.
Despite your comment, I still don't get why
node_module/webpack-dev-servercontains bothclient/index.jsandclient/index.bundle.js(As far as I understand, those are the same code : the source version and the transpiled version) and I can't find where theclient/index.jsversion is used and why it is used in this version (not the transpiled one). Again, I don't really grasp how webpack-dev-server is working in its entirety.shellscape commentedon Jan 9, 2018
client/index.bundle.jsis for folks that useinline: falseand such. There are examples demonstrating that in the repo. If you search for "index.bundle.js" at the top, in this repo, you'll find the examples that use it.sebtoun commentedon Jan 9, 2018
Why not using
client/index.bundle.jsinstead ofclient/index.jswhen usinginline: true? Aren't those two versions the same code before and aftertranspilation|minification?shellscape commentedon Jan 9, 2018
Because you'd be importing a webpack bundle into a webpack bundle as a module. It's just bad practice.
yyx990803 commentedon Jan 9, 2018
Shipping
babel-core+babel-loader+babel-preset-envas dependencies ofwebpack-dev-serveris definitely worse than just importing the pre-built bundle.shellscape commentedon Jan 9, 2018
@yyx990803 disagree. it's a dev tool. babel is a dev tool. same arena, the cost comes with the changes that were made.
yyx990803 commentedon Jan 9, 2018
What are the downsides of including a bundle in a bundle? If webpack can handle that properly, then the only issue is it being "bad practice", which does not affect the user in anyway.
On the other hand, including the whole babel suite as dependencies means you are shipping ~30Mb of extra payload if the user doesn't use babel, or uses an incompatible version of babel. This amounts to wasted bandwidth cost and installation time, and it compounds during CI jobs. This is a much more practical problem than having a bundle in a bundle.
shellscape commentedon Jan 9, 2018
@yyx990803 honestly guy. you pushed for your changes. the team caved to them. your changes broke a ton of implementations. I gave you the entirely reasonable fix I want to see (in multiple places) and now you're gonna push back against that.
You carry a lot of weight in the community due to Vue. I get it. But I'm done. Perhaps someone more amicable to your way will pick up maintenance of the project. ✌ out.
yyx990803 commentedon Jan 9, 2018
@shellscape I don't get your aggressiveness in all of this - I know you might have life stress, but as a maintainer myself I just have different perspectives on how the tradeoffs should be weighed. I tried to figure out a better solution after the first PR was rejected. I didn't even get a chance to defend the 2nd PR before you locked it. I simply disagree with your proposed solution of including babel as direct dependencies, for the reasons I outlined above. We are all just trying to find reasonable solutions to fix the problem for the users, and sometimes that means we may disagree on how that should be done, but that doesn't mean it's ok to just give in to your emotions instead of debating the actual problems. If you are busy with your life, maybe it is indeed time you take a break and let someone else take care of this project.
yyx990803 commentedon Jan 10, 2018
See #1270, which avoids "bundle in a bundle" and "babel as dependency" at the same time.
acierto commentedon Jan 10, 2018
What is the problem to do a concatenation of that line instead of interpolation to avoid this issue for IE11?
sebtoun commentedon Jan 10, 2018
The problem is more general than that line and IE11, it is an incompatibility between the whole client code (written with es6) and browsers that do not support all es6 features used.
acierto commentedon Jan 10, 2018
That's true, but if you don't want to transpile your code with heavy weight tools, why not just keep then the code in es5?
This problem was introduced in v2.8.0 and fixed afterwards, but by some reason it was decided to break it again from the version v2.10.0.
From my point of you, the complains are quite reasonable. The current decision of introducing that problem just holding from updating to the latest version. Or forces to create yet another 600+ fork to fix that issue for ones who have a product with customers using IE.
yyx990803 commentedon Jan 10, 2018
@acierto my 1st PR was converting all the client code back to ES5, but it was rejected likely because the maintainers didn't want to have to write ES5 only in one part of the codebase.
The break in 2.10 wasn't intentional, it was a regression introduced by my 2nd PR which attempted to transpile the client-side code with babel, so that all client source code can remain ES2015. However the bundling setup was actually used only in live mode and caused CLI inline mode to use the raw ES2015 files.
This should be fixed properly in #1270 though.