preactjs / preactjs/prefresh

[Webpack] Error overlay configuration

Open
#562 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
390
Forks
46
Avg merge
15h 50m
Merged PRs (30d)
3

Description

The overlay option for PreactRefreshPlugin is typed as a boolean in node_modules/@types/prefresh__webpack/index.d.ts

interface Options {
    overlay?: boolean;
    runsInNextJs?: boolean;
}

If I try to set it to true, an error will be thrown:

TypeError: The "request" argument must be of type string. Received undefined
    at Function.resolve (node:internal/modules/helpers:147:5)
    at ReloadPlugin.apply (/path/to/your/project/node_modules/@prefresh/webpack/src/index.js:135:45)
    at createCompiler (/path/to/your/project/node_modules/webpack/lib/webpack.js:81:12)
    at create (/path/to/your/project/node_modules/webpack/lib/webpack.js:154:16)
    at webpack (/path/to/your/project/node_modules/webpack/lib/webpack.js:182:32)
    at f (/path/to/your/project/node_modules/webpack/lib/index.js:78:21)
    at Object.<anonymous> (/path/to/your/project/scripts/run-dev-server.ts:14:25)
    at Module._compile (node:internal/modules/cjs/loader:1565:14)
    at Module.m._compile (/path/to/your/project/node_modules/ts-node/src/index.ts:1618:23)
    at node:internal/modules/cjs/loader:1708:10 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Based on this PR: https://github.com/preactjs/prefresh/pull/289 ; I guess it expects an object with a module key, what should I pass there then?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the overlay declaration in node_modules/@types/prefresh__webpack/index.d.ts and the ReloadPlugin.apply path in node_modules/@prefresh/webpack/src/index.js; compare their expectations with PR #289. Confirm the supported overlay shape, then reproduce webpack startup to verify the undefined request error is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.