protomaps / protomaps/basemaps

Executing 'render test' requires building subpackage first

Open
#550 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
740
Forks
104
Avg merge
26m
Merged PRs (30d)
2

Description

Hi,

From a clean install, I did:

cd render-tests
npm ci
npm run build
npm run test

which gave me the following output:

> render-test@1.0.0 test
> node dist/run_render_tests.js

node:internal/modules/esm/resolve:265
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/pietervdvn/git/basemaps/render-tests/node_modules/@protomaps/basemaps/dist/esm/index.js' imported from /home/pietervdvn/git/basemaps/render-tests/dist/run_render_tests.js
    at finalizeResolution (node:internal/modules/esm/resolve:265:11)
    at moduleResolve (node:internal/modules/esm/resolve:933:10)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///home/pietervdvn/git/basemaps/render-tests/node_modules/@protomaps/basemaps/dist/esm/index.js'
}

Node.js v20.16.0

So I did:

cd node_modules/@protomaps/basemaps
npm ci
npm run build

after which the tests worked as expected. IMHO, building the subpackage should not be needed and is an extra barrier to new contributors.

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 in the render-tests package by reproducing the clean-install sequence and inspect dist/run_render_tests.js together with the @protomaps/basemaps package resolution. Determine why @protomaps/basemaps/dist/esm/index.js is absent after the documented setup. Done means npm run test succeeds without entering node_modules or building the subpackage manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.