comments, seo, analytics, and presets publish ESM that fails to load in Node.js (follow-up to #149)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- build-system, release
Direzione di ricerca
Start with the tsup.config.ts of comments, seo and analytics to see the bundle: false setting that leaves relative specifiers extensionless, and compare against how #149 fixed translator (same repo, published config is the reference). For presets, read src/plugin.ts (the ../package.json import) and the relative imports in src/components/blocksDrawer/PresetItem/index.tsx and src/components/presetActions/BlockLabelWithPresets/index.tsx. Then run the repro.mjs snippet after building each package; done means all four print OK and tsc passes under node16/nodenext.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Four published ESM packages in this repo (@focus-reactive/payload-plugin-comments, -seo, -analytics, and -presets) cannot be loaded by Node's ESM resolver because their published dist files contain extensionless relative specifiers or a JSON import without type: "json" (the same class of issue #149 fixed for translator).
// repro.mjs
for (const pkg of [
"@focus-reactive/payload-plugin-comments",
"@focus-reactive/payload-plugin-seo",
"@focus-reactive/payload-plugin-analytics",
"@focus-reactive/payload-plugin-presets",
]) {
try {
await import(pkg);
console.log(pkg, "OK");
} catch (err) {
console.log(`${pkg}: ${err.code}: ${err.message.split("\n")[0]}`);
}
}
Run with:
npm install --legacy-peer-deps \
@focus-reactive/[email protected] \
@focus-reactive/[email protected] \
@focus-reactive/[email protected] \
@focus-reactive/[email protected]
node repro.mjs
Actual output:
@focus-reactive/payload-plugin-comments: ERR_MODULE_NOT_FOUND: Cannot find module '.../node_modules/@focus-reactive/payload-plugin-comments/dist/plugin' imported from .../node_modules/@focus-reactive/payload-plugin-comments/dist/index.js
@focus-reactive/payload-plugin-seo: ERR_MODULE_NOT_FOUND: Cannot find module '.../node_modules/@focus-reactive/payload-plugin-seo/dist/plugin' imported from .../node_modules/@focus-reactive/payload-plugin-seo/dist/index.js
@focus-reactive/payload-plugin-analytics: ERR_MODULE_NOT_FOUND: Cannot find module '.../node_modules/@focus-reactive/payload-plugin-analytics/dist/plugin' imported from .../node_modules/@focus-reactive/payload-plugin-analytics/dist/index.js
@focus-reactive/payload-plugin-presets: ERR_IMPORT_ATTRIBUTE_MISSING: Module "file:///.../node_modules/@focus-reactive/payload-plugin-presets/package.json" needs an import attribute of "type: json"
Expected: all four packages resolve and load in Node.js (and type-check cleanly under moduleResolution: "node16" / "nodenext"), matching ab, html-preview, json-form-builder, netlify-deploy, scheduling, translator, and visual-editing.
#149 noted presets as unbundled swc and assumed the tsup-built plugins bundled relative imports away, but comments, seo, and analytics set bundle: false in tsup.config.ts (leaving all 249, 369, and 757 relative JS imports and their .d.ts imports extensionless), while presets has import packageJson from "../package.json" in src/plugin.ts plus extensionless relative imports in src/components/blocksDrawer/PresetItem/index.tsx and src/components/presetActions/BlockLabelWithPresets/index.tsx.
Tested on @focus-reactive/[email protected], @focus-reactive/[email protected], @focus-reactive/[email protected], and @focus-reactive/[email protected] (npm latest), and built from main (b0644fd54) with Node.js v26.13.0.
Credit: https://ucsbplse.github.io/
- Lingua principale
- TypeScript
- Stelle
- 34
- Fork
- 5
- Merge medio
- 2g 4h
- PR unite (30g)
- 41
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di focusreactive/payload-plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
focusreactive/payload-plugins#279 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
focusreactive/payload-plugins#263 ·
I maintainer di solito rispondono entro 1 giorno
-
released released on @next
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
focusreactive/payload-plugins#210 · 10 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[translator] Re-extract the traversal engine into its own packageForse di nuovo libera @SearheiParkhamchuk l’ha presa 41 giorni fa e non c’è nessuna pull request aperta. Apertachore low priority translator
focusreactive/payload-plugins#203 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[translator] Open the seam to hosts: export the module type and provenance()Forse di nuovo libera @SearheiParkhamchuk l’ha presa 41 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement low priority translator
focusreactive/payload-plugins#202 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di focusreactive/payload-plugins
Issue simili
-
verified whatsapp
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 6 giorni
-
Feature: use a darkmode logoAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
openidconnect: option to use client_secret_post (client_id with "-" rejected by LemonLDAP::NG 2.21)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Amélioration du résumé regAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
MTES-MCT/monitorenv#3257 ·
I maintainer di solito rispondono entro 1 giorno