Odd absence of syntax error detection in console w/ firebase-3-react
See original GitHub issueTLDR: adding firebase-3-react
breaks the browser with a SyntaxError but the build console doesn’t detect it:
STR:
> create-react-app test-fb-react
> cd test-fb-react
> npm install --save firebase-3-react
then add the following line to src/App.js
:
import { init } from "firebase-3-react";
then:
> npm start
Result is the console shows nothing particularly wrong:
Compiled with warnings.
Warning in ./src/App.js
/Users/dascher1/src/test-fb-react/src/App.js
4:10 warning 'init' is defined but never used no-unused-vars
✖ 1 problem (0 errors, 1 warning)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
^C
~/src/test-fb-react 1m 50s
but the browser (Chrome, OSX, 52.0.2743.116) shows:
and the app is broken.
This module (firebase-3-react
) is written in Typescript, which is the only thing that seems unusual about it.
/cc @peterellisjones who may have ideas, as it’s his module.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
SyntaxError - JavaScript - MDN Web Docs
The SyntaxError object represents an error when trying to interpret syntactically invalid code. It is thrown when the JavaScript engine encounters tokens or ......
Read more >Using ECMAScript21 in VSCode creates syntax error
When importing the app to Visual Studio Code (VSCode), trying to sync the same Script include I get this error: Syntax errors detected...
Read more >Weird syntax error for just comment lines - javascript
I have solved it. It strangely worked when I removed the space between the () and the curly brackets in the jquery document...
Read more >if / else errors - learn how to fix these - Codecademy
I've been stuck on 6/9 for an hour with a syntax error that I have not been able to find an answer to....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @davidascher, thanks for bringing this to my attention.
As @insin mentioned I was previously transpiling the Typescript source to ES6 module (doh!). I’ve updated the code to now target es3 using commonjs and have added tests to check that both
require
andimport
syntax work.Thanks for the STR, I’ve confirmed it no longer produces compilation warnings or errors in the browser console.
firebase-3-react@1.0.20 has the new changes, please let me know if you continue to have any issues.
cheers,
Pete
@peterellisjones Thanks for very quick fix.