Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

JS file error: Unexpected token < #176

Open
WuboDev opened this issue Jul 31, 2019 · 14 comments
Open

JS file error: Unexpected token < #176

WuboDev opened this issue Jul 31, 2019 · 14 comments
Labels
Status: Possible Bug This issue is a possible bug, but might not be (could be a misunderstanding or a false positive).

Comments

@WuboDev
Copy link

WuboDev commented Jul 31, 2019

Hi

I found all the js files in my theme includes ERROR: Unexpected token <, line 1. Even I delete all codes and only leave an empty file.

Does anyone have the same issue?

@dingo-d dingo-d added the Status: Possible Bug This issue is a possible bug, but might not be (could be a misunderstanding or a false positive). label Aug 1, 2019
@dingo-d
Copy link
Member

dingo-d commented Aug 1, 2019

We are considering removing JS sniffing all-together as JS files can cause a memory exhaustion (especially if they are minified).

I'll try to look more in depth about this, can you just link your theme so that I can test?

@WuboDev
Copy link
Author

WuboDev commented Aug 2, 2019

Hi

Of course, my theme is free, you can download it from here https://github.com/LovageIO/lovage

Thanks

@BinaryMoon
Copy link

Hi - my theme is getting this same error for every javascript file, and I have quite a few of them. I have split my js out into separate files that then get concatenated by gulp.

My theme is here, you're welcome to test it: https://github.com/BinaryMoon/jarvis

@vbaimas
Copy link

vbaimas commented Aug 15, 2019

Hi

I found all the js files in my theme includes ERROR: Unexpected token <, line 1. Even I delete all codes and only leave an empty file.

Does anyone have the same issue?

Hello @LovageIO I have the same issue.

@dingo-d if you want to see it in action, you can download my theme from here : https://github.com/vbaimas/fashionclaire

@icc365
Copy link

icc365 commented Aug 24, 2019

Just my input that I am experiencing this issue as well with the ERROR: Unexpected token <, line 1
For testing my themes, I will probably remove the Theme Sniffer for now and revert back to the older one I had. If I submit any themes to the repo, I will probably add a special note to the reviewer to ignore the error(s) and link to Github here.

@dingo-d
Copy link
Member

dingo-d commented Aug 24, 2019

Just a small note: as is mentioned in the review handbook, Theme Sniffer is just a tool to help with the review process, not a requirement.

It's a work in process, and if anybody would like to contribute I'd welcome the help 🙂

@joyously
Copy link

Just saw this: https://snyk.io/test/
"Check for known vulnerabilities in public GitHub repos, npm packages and Docker images"

@dingo-d
Copy link
Member

dingo-d commented Aug 25, 2019

I think snyk just tests the dependency vulnerabilities (in npm packages).

@dingo-d
Copy link
Member

dingo-d commented Oct 20, 2019

@BinaryMoon I hope you won't try to submit your theme with the docs in them. I tried to use the sniffer and I got memory timeout, not 100% sure if it's due to the docs but my PhpStorm froze when it tried to index all the files 😄

I'm trying to work out where the memory exhaustion comes from, still hadn't nailed it fully.

@BinaryMoon
Copy link

@dingo-d I don't plan to bundle the docs with the theme :)

If you were to install everything (npm install) then gulp buildZip will generate the zip file that I will be submitting.

Surprised PHPStorm froze. I use VSCode and have an entire WordPress install, and all of my commercial themes, a bunch of free themes, and about 30 plugins all in a single project. I know PHP Storm is well used so I would have imagined it could do similar.

@dingo-d
Copy link
Member

dingo-d commented Oct 21, 2019

I had 5 opened PhpStorm windows and I think that the indexing killed it.

@dingo-d
Copy link
Member

dingo-d commented Mar 30, 2020

HI @BinaryMoon I am just working on the sniffer (removing JS checks) and so I tested your theme, and it killed the sniffer again. So I went to look at it and the tests folder killed it xD The woocommerce-stubs-3.7.0.php has 68k lines! So it ran out of memory.

But this is great, as I'll now add tests to excluded folder list 😄

@BinaryMoon
Copy link

@dingo-d Ha haa - I can see how that would be a problem. That file didn't exist when I first ran into this problem :)

@dingo-d
Copy link
Member

dingo-d commented Mar 30, 2020

I've also excluded JS sniffing for now. Will put this back at a later date 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Possible Bug This issue is a possible bug, but might not be (could be a misunderstanding or a false positive).
Projects
None yet
Development

No branches or pull requests

6 participants