Skip to content

using preact/debug with no build tools #2253

@keturn

Description

@keturn

I'm using Preact following the "no build tools" route in the Getting Started guide. (It's a great option for these tiny demos I'm working with!)

This import statement finds something to load:

import "https://unpkg.com/preact@latest/debug/dist/debug.module.js?module";

then it dies because process is undefined.

Adding this to my document before I load my module makes it work. I think. Preact Developer Tools does connect and recognize the component.

<script>
  window.process = {env: {NODE_ENV: 'development'}};
</script>

but there's some room for improvement there. Probably both in the preact/debug module build so it doesn't rely on the nodejs environment, and in the debugging guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions