I’ve deployed successfully on cloudflare worker the new framework from Shopify: Hydrogen.
Since 10 days it is reporting this error and i don’t know how to solve it. no changes in the worker file and is not working the default boilerplate too, with no changes. that was working some days ago
Error: Something went wrong with the request to Cloudflare…
Uncaught TypeError: Cannot assign to read only property ‘scheduler’ of object ‘#’
at line 11125
[API code: 10021]
the worker is very simple:
import handleEvent from '@shopify/hydrogen/worker';
import entrypoint from './src/entry-server.jsx';
// eslint-disable-next-line node/no-missing-import
import indexHtml from './dist/client/index.html?raw';
import {getAssetFromKV} from '@cloudflare/kv-asset-handler';
async function assetHandler(event, url) {
const response = await getAssetFromKV(event, {});
if (response.status < 400) {
const filename = url.pathname.split('/').pop();
const maxAge =
filename.split('.').length > 2
? 31536000 // hashed asset, will never be updated
: 86400; // favico and other public assets
response.headers.append('cache-control', `public, max-age=${maxAge}`);
}
return response;
}
addEventListener('fetch', (event) => {
try {
event.respondWith(
handleEvent(event, {
entrypoint,
indexTemplate: indexHtml,
assetHandler,
cache: caches.default,
})
);
} catch (error) {
event.respondWith(
new Response(error.message || error.toString(), {
status: 500,
})
);
}
});