Skip to content
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

Firebase serve: 'Unexpected token <' after firebase serve #899

Closed
tjb1187 opened this issue Aug 30, 2018 · 1 comment
Closed

Firebase serve: 'Unexpected token <' after firebase serve #899

tjb1187 opened this issue Aug 30, 2018 · 1 comment

Comments

@tjb1187
Copy link

tjb1187 commented Aug 30, 2018

Having the same problem as:

#871

Except instead of deploying I am only serving.

When index.html page loads on local server I receive the warning in my console:

"Uncaught SyntaxError: Unexpected token <"

I initially had the issue on 4.2.1. Then I rolled back to firebase-tools 4.1.1 as prescribed in #871 but still have the problem.

When I visit the folder path in Chrome the app works flawlessly. I only see this when serving it on localhost.

Version info

4.2.1 & 4.1.1

Platform Information

Windows 7

Steps to reproduce

firebase serve

Request \public\index.html on localhost:5000

Expected behavior

Page loads, javascript functions

Actual behavior

Page loads fine, console only shows index.js and firebase.js in the source navigator but shows index.html code under index.js

console reads:
Uncaught SyntaxError: Unexpected token < @ index.js:1 (index.js is comments at line 1)

@mbleigh
Copy link
Contributor

mbleigh commented Aug 31, 2018

This is usually due to your webpage referencing a JS file that doesn't exist, and your rewrite rules serving up an HTML page at the JS file's location. Make sure that your <script src> tag is properly referencing the relative/absolute path of your JS file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants