question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Odd absence of syntax error detection in console w/ firebase-3-react

See original GitHub issue

TLDR: 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:

screenshot 2016-08-15 10 35 13

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:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
peterellisjonescommented, Aug 15, 2016

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 and import 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

0reactions
gaearoncommented, Aug 16, 2016

@peterellisjones Thanks for very quick fix.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found