Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see unminified Preact source code in Chrome debugger #2370

Open
skybrian opened this issue Mar 21, 2024 · 0 comments
Open

Can't see unminified Preact source code in Chrome debugger #2370

skybrian opened this issue Mar 21, 2024 · 0 comments

Comments

@skybrian
Copy link

skybrian commented Mar 21, 2024

I haven't been able to use Chrome's debugger to look at Preact source code, set breakpoints, and so on. Here's what I figured out so far:

Where does Preact source code come from?

Looks like Fresh sets up deno.json to get it from esm.sh/preact@10.19.2/denonext, and I do see the minified source in Chrome. Furthermore, these files do have sourcemaps, but Chrome doesn't seem to load them.

Are there any relevant Chrome settings?

I did see a setting in Chrome DevTools preferences, under "Sources":

Allow DevTools to load resources, such as source maps, from remote file paths. Disabled by default for security reasons.

However, turning it on had no apparent effect.

I also looked at "Developer Resources" (based on advice from here, but it only lists files on localhost.

Do other third-party libraries work?

Yes, I can look at Zod source that's pulled from deno.land.

Could Preact be loaded from somewhere else?

I tried switching to npms, but I don't know how to map "preact/" so that loading preact/hooks will work. I get this error:

error: Failed to resolve the specifier ""preact/hooks"" as its after-prefix portion ""hooks"" could not be URL-parsed relative to the URL prefix "npm:preact@10.19.2/" mapped to by the prefix "preact/" at https://deno.land/x/fresh@1.6.5/src/runtime/csp.ts:2:28

What could Fresh do?

Maybe there's another way to load Preact so that it works by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant