My react app gives an error for some reason - reactjs

Error:
src\images\navbar.js
Line 2:11: Parsing error: Unexpected token, expected "from" (2:11)
src\navbar.js
Line 2:11: Parsing error: Unexpected token, expected "from" (2:11)
the project on GitHub: https://github.com/PufflyMan/airbnb-exp-clone
It's pretty straightforward code but no matter what I tried, I couldn't fix it. Thanks for attention!

It just fixed itself. I didn't do anything

Related

Jest-Expo ( SyntaxError: Unexpected token 'export' )

can someone help me trough this please, dont get why i get this export error? Error Message
My test file
Have you followed the instructions to set up per https://docs.expo.io/guides/testing-with-jest/ ?
This section looks most promising based on reading our error: https://docs.expo.io/guides/testing-with-jest/#jest-configuration

React - Unexpected token, expected - syntax error

I am getting a syntax error in my react app in my src/app.js file. I have attached pictures that describe the problem. The error is on line 74. part 1part 2
Try closing the block with }) instead of } at line 71

Angular? throwing unexpected token because of less?

I'm using:
JSPM, SystemJS and Angular
I can't import less files without running into a series of errors:
Error: [$parse:syntax] Syntax Error: Token 'text' is an unexpected token at column 8 of the expression [status text] starting at [text].
http://errors.angularjs.org/1.5.0/$parse/syntax?p0=text&p1=is%20an%20unexpected%20token&p2=8&p3=status%20text&p4=text
at eval (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:68:12)
at Object.AST.throwError (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:13816:11)
at Object.AST.ast (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:13586:12)
at Object.ASTCompiler.compile (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:14040:31)
at Parser.parse (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:14927:29)
at $parse (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:15035:39)
at $interpolate (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:11770:25)
at addTextInterpolateDirective (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:9282:27)
at collectDirectives (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:8350:11)
at compileNodes (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:8145:22) undefined
I've read a lot online and found that for some people it was the encoding of the file, but I've tried several things including the one below with no luck:
#charset "utf-8";
/* CSS Document */
Any ideas why is that happening?
Please, let me know if there are any parts of my code that could be of help.
EDIT:
Thanks!
The problem was a comment!! I have no idea why, but Angular was trying to parse the comment:
/*
---------------------------------------
A status badge.
---------------------------------------
Usage:
<span class="badge badge-status">
{{status text}}
</div>
---------------------------------------
*/
I solved it by removing the comment.

clean-css TypeError cannot read property '0' of null

I am trying to minify my code and i always get this error when it runs clean-css.
/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:66
return name.replace(/^\-\w+\-/, '').match(/([a-zA-Z]+)/)[0].toLowerCase();
^
TypeError: Cannot read property '0' of null
at findNameRoot (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:66:59)
at extract (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:36:9)
at restructure (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/restructure.js:297:22)
at optimize (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/advanced.js:71:5)
at minify (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:228:5)
at whenSourceMapReady (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:135:7)
at Object.whenDone (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/clean.js:155:14)
at processNext (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:105:13)
at importFrom (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:79:10)
at ImportInliner.process (/home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/imports/inliner.js:38:10)
Error: Hook failed with error code 8: /home/k1ngsley/Projects/mobile_rea/partners-mobile-app/hooks/after_prepare/070_uglify.js
at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:195:23
at _rejected (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:797:24)
at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:823:30
at Promise.when (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:741:41)
at /home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/home/k1ngsley/npm/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:448:13)
I have read different posts that says remove commented lines etc but all hasnt worked out for me.
Any one has any other ideas or ways to solve this issue
Take a look at min.css utility that is more fastest and fault-tolerance.

Parse error while rendering the pdf file in angularjs app

When I try to access the pdf file which is public using the angular-pdf-viewer I got the following error message on console.
Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 5 of the expression [http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf] starting at [://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf].
here is my pdf directive for rendering the pdf file:
<pdf-viewer delegate-handle="my-pdf-container" url="http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf" scale="1" show-toolbar="true" ></pdf-viewer>
could anyone help on this issue?
all the samples seems to be suggesting define url on scope and reference it. But you may try the following, which stringifys the url
<pdf-viewer delegate-handle="my-pdf-container" url="'http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf'" scale="1" show-toolbar="true" ></pdf-viewer>

Resources