Skip to content

Make pnpm dev work in a plain clone, and behind a localhost tunnel #63

Description

@jankarres

I cloned the repo, ran pnpm install, then pnpm dev browser, and got ten copies of Can't resolve '@shellular/protocol'.

It comes from a dev-only alias in webpack.config.js:

alias = {
    // assuming app & packages are in the same monorepo, adjust as needed
    "@shellular/protocol": resolve("../packages/protocol/dist/index.js"),
};

The comment is honest about the assumption, but nothing checks it, and a plain clone has no ../packages. The package is a normal dependency and is already sitting in node_modules, so pnpm build browser is fine and only pnpm dev breaks, which is a confusing thing to run into on day one. An existsSync around the alias would be enough.

Second thing, smaller and related. My editor runs on a different machine than my browser, over VS Code Remote. The dev server always binds the first non-internal IPv4, and for the browser target it always serves https with a self-signed certificate, with no way to change either. Through a tunnel the only address that forwards is 127.0.0.1, and plain HTTP on localhost is already a secure context, so OPFS and WebCrypto work and there is no certificate warning every reload.

--host, --port and --http on dev/start.js would cover it, plus something like --no-open so a headless box does not try to launch a browser. Defaults unchanged, so the phone-on-the-same-Wi-Fi flow stays exactly as it is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions