aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
653 stars 58 forks source link

FIX - createManifestValidator failing because schemastore.org is returning 503 #183

Closed ssf01 closed 8 months ago

ssf01 commented 8 months ago

In the last two days builds time out due to the issue with the website https://json.schemastore.org.

I propose updating the SCHEMA_URL from its current https://json.schemastore.org/chrome-manifest URL to the raw GitHub content URL https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/chrome-manifest.json. GitHub has superior availability and it's a smaller change that we will encounter this issue again.

...
vite v5.1.0 building for development...
✓ 1 modules transformed.
dist/src/index.css  26.42 kB │ gzip: 4.85 kB
✓ built in 186ms
undefined:1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
^

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (file:///path/to/project/node_modules/.pnpm/vite-plugin-web-extension@4.1.1/node_modules/vite-plugin-web-extension/dist/index.js:949:20)
    at IncomingMessage.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.11.0

Fixes #182 .