WPTT / theme-sniffer

Theme Sniffer plugin using sniffs.
MIT License
269 stars 3 forks source link

JS file error: Unexpected token < #176

Open WuboDev opened 5 years ago

WuboDev commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Hi

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

Thanks

BinaryMoon commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

dingo-d commented 5 years ago

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

dingo-d commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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

dingo-d commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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