throw error

pull/5370/head
filip mertens 2 years ago committed by Aniket
parent f4b3bff280
commit d27e269199
  1. 7
      libs/remix-url-resolver/src/resolve.ts

@ -128,7 +128,7 @@ export class RemixURLResolver {
* @param url The url of the NPM import statement
*/
async handleNpmImport(url: string): Promise<HandlerResponse> {
const urls = ["https://cdn.jsdelivr.net/npm/", "https://unpkg.com/"]
const urls = ["https://cdn.jsdelivr.net/npm/o", "https://unpkg.com/"]
process && process.env && process.env['NX_NPM_URL'] && urls.unshift(process.env['NX_NPM_URL'])
let content = null
// get response from all urls
@ -142,9 +142,8 @@ export class RemixURLResolver {
// try next url
}
}
return { content: content, cleanUrl: url }
if (!content) throw new Error('Unable to load ' + url)
return { content, cleanUrl: url }
}

Loading…
Cancel
Save