skypackjs / skypack-cdn

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

[Package issue] preact-router/match #41

Open zachasme opened 4 years ago

zachasme commented 4 years ago

I'm trying to get preact-router working through skypack cdn, but importing preact-router/match fails.

Import

import("//cdn.skypack.dev/preact-router@^3.2.1/match");

Result

// Uncaught (in promise) ReferenceError: exports is not defined

Debugging

The file served contains Object.defineProperty(exports, "__esModule", { value: true }); as the very first line.

drwpow commented 3 years ago

Hey @zachasme! An update: we’ve made some improvements to the CDN, and it seems that /preact-router is working fine, but you’re right that /preact-router/match still has some issues.

I’d recommend importing /preact-router/src/match.js instead, as that seems to already be better-written for the browser. But we have a bug at the moment that’s preventing you from using that. That should be resolved soon, though.