Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

update-bcd broken since BCD moved to fdir #2036

Closed
gsnedders opened this issue May 27, 2022 · 4 comments · Fixed by #2038
Closed

update-bcd broken since BCD moved to fdir #2036

gsnedders opened this issue May 27, 2022 · 4 comments · Fixed by #2038
Assignees

Comments

@gsnedders
Copy link
Contributor

After mdn/browser-compat-data@8ad738a (mdn/browser-compat-data#5653):

gsnedders@gsnedders-milk mdn-bcd-collector % time npm install && npm run update-bcd -- --help

> mdn-bcd-collector@6.0.5 prepare
> node scripts.js prepare

> node install.js
Requesting latest Firefox Nightly version from https://product-details.mozilla.org/1.0/firefox_versions.json
Firefox Nightly is already in /Volumes/gsnedders/projects/mdn/bcd/mdn-bcd-collector/node_modules/puppeteer/.local-firefox/mac-102.0a1; skipping download.

up to date, audited 897 packages in 2s

105 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm install  1.63s user 0.27s system 105% cpu 1.802 total

> mdn-bcd-collector@6.0.5 update-bcd
> node update-bcd.js "--help"

node:internal/modules/cjs/loader:939
  const err = new Error(message);
              ^

Error: Cannot find module 'fdir'
Require stack:
- /Volumes/gsnedders/projects/mdn/bcd/browser-compat-data/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at Module._load (node:internal/modules/cjs/loader:780:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Volumes/gsnedders/projects/mdn/bcd/browser-compat-data/index.js:8:18)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Volumes/gsnedders/projects/mdn/bcd/browser-compat-data/index.js'
  ]
}

Node.js v18.2.0

What's perhaps more surprising to me is that this keeps happening even after npm install 'fdir@~5.2.0', but clearly I don't understand npm packaging :)

@foolip
Copy link
Owner

foolip commented May 30, 2022

@queengooborg I guess the fix in #2038 works, but it looks very strange to me. mdn-bcd-collector doesn't use fdir directly, only via BCD. Shouldn't the fix be something like installing all of BCD's dependencies?

@queengooborg
Copy link
Collaborator

We could do something like that, though that'd also mean installing numerous dependencies we aren't using at all for the collector. That'll probably become less relevant overtime as the collector's dependencies become similar to BCD's.

@foolip
Copy link
Owner

foolip commented May 30, 2022

I don't mean to add BCD's dependencies as dependencies of the collector, but just to npm install in the BCD copy we're updating. Or doesn't that work?

@queengooborg
Copy link
Collaborator

Ah, no, that doesn't work, otherwise we'd not have this issue come up so quickly and by existing contributors. We need to include fdir here to place it in our node_modules, so that when we import the script in BCD, NodeJS can find and import fdir.

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

Successfully merging a pull request may close this issue.

3 participants