-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
IE11 fails to load with Invalid character error #1268
Comments
@creage thanks for the report. this is a great opportunity for a first pull request. We'd happily review one. |
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: const rule = {
test: /\/client\/.*\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
['env']
]
}
}
}; That also means that the babel dependencies need to be moved to |
I have the same issue using Firefox 38.4.0: injected client code is not transpiled to es5. The faulty injected code resides in |
@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. |
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 |
|
Why not using |
Because you'd be importing a webpack bundle into a webpack bundle as a module. It's just bad practice. |
Shipping |
@yyx990803 disagree. it's a dev tool. babel is a dev tool. same arena, the cost comes with the changes that were made. |
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. |
@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. |
@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. |
See #1270, which avoids "bundle in a bundle" and "babel as dependency" at the same time. |
What is the problem to do a concatenation of that line instead of interpolation to avoid this issue for IE11? |
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? 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. This should be fixed properly in #1270 though. |
Expected Behavior
Webpack-dev-server allows running my app in IE11
Actual Behavior
This code makes webpack based development impossible to run in IE11, as it fails with error
SCRIPT1014: Invalid character, index.js (361,13)
For Bugs; How can we reproduce the behavior?
Start any basic example of webpack-dev-server in IE11
The text was updated successfully, but these errors were encountered: