-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
compilation errors caused by rollup deleting minimized firebase semicolon #1275
Comments
Your rollup config works fine with: There is a warning about firebase's use of |
Sure, it creates an output file. I would prefer it to create a valid javascript file, instead. For example: |
I ran the generated rollup output file through [email protected] as well as [email protected] and confirmed it is valid javascript file. I did not see the string in question. Please verify the versions of the modules match the ones I listed above. |
I see what you mean now. The rollup output contains:
Must be some issue with line wrap. |
I had run the original input through |
Repro: rollup version 0.41.4 $ cat r.js
$ rollup r.js -f es
$ rollup r.js -f es | node
Possible fix: --- a/src/ast/nodes/VariableDeclaration.js
+++ b/src/ast/nodes/VariableDeclaration.js
@@ -98,7 +98,7 @@ export default class VariableDeclaration extends Node {
const needsSemicolon = !forStatement.test( this.parent.type );
if ( this.end > c ) {
- code.overwrite( c, this.end, needsSemicolon ? ';' : '' );
+ code.overwrite( c, this.end, needsSemicolon ? ';' : '\n' );
} else if ( needsSemicolon ) {
this.insertSemicolon( code );
} Either that or unconditionally introduce curly braces around the body of loops similar to how Bublé does it. |
could be a pull request? |
Sure, go for it. When you make a PR be sure to include the test above. See ffe6b0b for an example of a test. |
I have encountered the same bug, in the same context of firebase. I'm trying to understand why this bug somehow leaves so much other code working correctly. Reading the source code (around the lines in the diff above), it sure seems like this would not be a very rare edge case. |
Sed hackery, for anyone stuck by this bug:
This is an ugly, ugly thing to do, but it got my build process back up and going without having to roll back to a pre-October rollup. |
The problem manifests itself more often when the input is minified. See: #1275 (comment) |
@kzc Thanks - now I get it. It is an unusual coding pattern that hits this bug. Something a minifier would write, not something a human would write. Hence Firebase - which is distributed in minified form. |
still happens in 0.41.5. The broken auth statement is d = g + gh | 0a.h[0] = a.h[0] in auth.js of firebase 3.7.1 |
It still happens because no PR was made. |
I tried to use babili minifier with sourcemaps, which requires rollup > 0.41.5. But this bug is still happening in rollup 0.41.6. I think I'll have to try the sed command. |
this shouldnt be ignored ! firebase is unusable with rollup |
As kzc mentioned, feel free to create a PR with that fix |
I tried the suggested change in #1275 (comment) , now the setup compiles with importing firebase, however with my current setup I get
during page load no matter if the fix is applied or not. This is with rollup 0.41.6 and buble. |
please create a new issue with a reproduction |
After banging my head against the wall for a while I realsed that this is an issue with the way the Firebase source refers to this in firebase/database in my case, so a workaround similar to #1007 (comment) seems to have solved the issue for now. With
seems to do the trick. This is with rollup 0.41.6 and firebase 3.9.0 / 4.0.0. It would seem that my problems are unrelated to the original issue reported here, which for me seems to work out of the box. |
any news? |
Try firebase v4.1. |
Thanks @Shyam-Chen ! |
fixed in 0.46 |
I have a firebase project that rollup is failing to build. I determined that rollup was corrupting the auth.js file out of firebase by removing meaningful semicolon. Rolling back rollupjs to version 0.36.1 "fixed" me. You probably want to look at this.
g+oe|0a.h[0]
is the broken substr.Minimized rollup.config.js follows:
The text was updated successfully, but these errors were encountered: