skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

[Package Error] "@miniflare/d1" could not be built. #344

Open nanai10a opened 1 year ago

nanai10a commented 1 year ago

try to import https://cdn.skypack.dev/@miniflare/d1 from deno, then respond with:

/*
 * [Package Error] "@miniflare/d1@v2.12.1" could not be built.
 *
 *   [1/5] Verifying package is valid…
 *   [2/5] Installing dependencies from npm…
 *   [3/5] Building package using esinstall…
 *   Running esinstall...
 *   Failed to load node_modules/@miniflare/d1/dist/src/index.js
 *     Unexpected token (236:8) in @miniflare/d1/dist/src/index.js
 *   Install failed.
 *   Install failed.
 *
 * How to fix:
 *   - If you believe this to be an error in Skypack, file an issue here: https://github.com/skypackjs/skypack-cdn/issues
 *   - If you believe this to be an issue in the package, share this URL with the package authors to help them debug & fix.
 *   - Use https://skypack.dev/ to find a web-friendly alternative to find another package.
 */

console.warn("[Package Error] \"@miniflare/d1@v2.12.1\" could not be built. \n[1/5] Verifying package is valid…\n[2/5] Installing dependencies from npm…\n[3/5] Building package using esinstall…\nRunning esinstall...\nFailed to load node_modules/@miniflare/d1/dist/src/index.js\n  Unexpected token (236:8) in @miniflare/d1/dist/src/index.js\nInstall failed.\nInstall failed.");
throw new Error("[Package Error] \"@miniflare/d1@v2.12.1\" could not be built. ");
export default null;                                                        

but source (npm:@miniflare/d1) is actually:

// (l:232) --- snip ---
    if (returnsData(stmt))
      throw new Error(EXECUTE_RETURNS_DATA_MESSAGE);
    const params = normaliseParams(query.params);
    const result = stmt.run(params);
    meta.last_row_id = Number(result.lastInsertRowid);
    meta.changes = result.changes;
    return ok(null, meta);
// (l:240) --- snip ---
    const result = stmt.run(params);
//     ^ (236:8) is here

Thanks.