React - Unexpected token, expected - syntax error - reactjs

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

Related

Why is vercel showing a white screen?

I am trying to deploy my portfolio website. It shows the proper log-in animation but then just shows a white screen. I have no idea why this is happening, the logged error message references unhelpful code from the site generator.
the error is in console. and in Skills.js file in line 48.
TypeError: Cannot read properties of undefined (reading 'map')
you can fixed it by adding question mark like this :
{ skillsSection.skills?.map((skills, i)=> ....
and there is another error : twitter.js:14 Uncaught TypeError: Cannot read properties of null (reading 'innerHTML')
in twitter.js file in line 14
just add question mark there too. like this :
if (!document.getElementById("twitter")?.innerHTML.includes("iframe"))

My react app gives an error for some reason

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

next.js npm module comment giving an error

This is my error
10:03:56.049 ./components/navbar.js
10:03:56.049 13:33 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
10:03:56.049 39:33 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
10:03:56.049 Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
10:03:56.051 info - Creating an optimized production build...
10:04:04.307 Failed to compile.
10:04:04.308 HookWebpackError: Unexpected '/'. Escaping special characters with \ may help.
10:04:04.308 > Build error occurred
10:04:04.309 Error: > Build failed because of webpack errors
10:04:04.309 at /vercel/path0/node_modules/next/dist/build/index.js:15:924
10:04:04.309 at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:6:584)
10:04:04.333 Error: Command "npm run build" exited with 1
At first I thought it was coming from navbar.js but I don't see any "special characters" there, here is my navbar.js: https://pastebin.com/8XFUtL5A
So then I went and checked node_modules/next/dist/telemetry/trace/trace.js:6:584 and I found a lot of comments there: https://pastecord.com/epygazosib.js
So how do I solve this error? Because I saw a similar error someone else had but they are using angular
I have fixed this by simply removing all the comments in all my css files
In my case I made a mistake in the comments in my stylesheet page.
I had something like this
/*/*Comment*/
*/.className{
}
so removing the comment solved the bug for me.
/*Comment*/
.className{
}

JSON parse error on running `hugo` command

I'm trying to build a blog using Hugo. Every time I run the hugo command, I get this error
ERROR 2021/06/22 18:57:50 JSON parse error: expected comma character
or an array or object ending on line 52 and column 40
12: {
^
Total in 145 ms
Error: Error building site: failed to render pages: JSON parse error:
expected comma character or an array or object ending on line 52 and column 40
12: {
^
I suspect my project directory structure to be the problem but I'm open to more questions about the situation.
My project directory structure looks like
root-folder
--content
--posts
--my-first-post.md
--posts-again
--my-second-post.md
--my-third-post.md
--my-fourth-post.md
and all markdown files contain exactly the following
---
title: "Project"
date: 2021-06-22T18:09:26+01:00
draft: false
---
This is a post
When draft is set to true, I don't get the error when I run the hugo command. The error comes up when draft for any of the files in posts or posts-again is set to false
I have searched every file for a line 52 that I can understand but I cannot find any.
Where could this error be coming from and how can I resolve it?
hugo serve and hugo serve -D work fine, but hugo doesn't
hugo-PaperMod is missing a comma in a JSON block in layouts/partials/templates/schema_json.html
I got this error and just pushed up a PR to fix it
https://github.com/adityatelange/hugo-PaperMod/pull/614
this may be your issue
Issue is baseurl set to "/" in config.toml.
Change it to "" and try

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