denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.85k stars 5.39k forks source link

deno publish failed with error: error[excluded-module] when export casing differs from file casing #24635

Open UrielCh opened 4 months ago

UrielCh commented 4 months ago

Version: Deno 1.45.2

I have 37 generated project to publish, so they have all the same shape.

some of them failed with error :

Checking for slow types in the public API...
error[excluded-module]: module in package's module graph was excluded from publishing
 --> /dev/react-icons-gi/ico/Gi3dGlasses.ts
  = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file or use 'publish.exclude' with a negative glob to unexclude from gitignore

  info: excluded modules referenced via a package export will error at runtime due to not existing in the package
  docs: https://jsr.io/go/excluded-module

error[excluded-module]: module in package's module graph was excluded from publishing
 --> /dev/react-icons-gi/ico/Gi3dHammer.ts
  = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file or use 'publish.exclude' with a negative glob to unexclude from gitignore

  info: excluded modules referenced via a package export will error at runtime due to not existing in the package
  docs: https://jsr.io/go/excluded-module

The error message is not relevant, I had only exclude my .github folder, and the error is the same without any exclude.

error sample: https://github.com/UrielCh/react-icons-gi/actions/runs/9988509932/job/27605141756

similar project without the error: https://github.com/UrielCh/react-icons-ai/actions/runs/9988506667/job/27605128093

all those project will be published here

UrielCh commented 4 months ago

Note this project have 4038 exports.

removing the export:

    "./Gi3dGlasses": "./ico/Gi3dGlasses.ts",
    "./Gi3dHammer": "./ico/Gi3dHammer.ts",
    "./Gi3dMeeple": "./ico/Gi3dMeeple.ts",
    "./Gi3dStairs": "./ico/Gi3dStairs.ts",
    "./GiBottomRight3dArrow": "./ico/GiBottomRight3dArrow.ts",

make the publish works. see commit: https://github.com/UrielCh/react-icons-gi/commit/5eb8efe87bbffe559e2f40434836c4273d2e19a7

but those export should be valide.

dsherret commented 4 months ago

The problem here is the export value is "./ico/Gi3dGlasses.ts", but the file itself is cased as Gi3DGlasses.ts. Update the export value to be the same as the file and it should work. We'll have to add a better diagnostic here for this situation because it won't work when published.

UrielCh commented 4 months ago

Oups, thx for the 👁️

I'm not shure it worth implementing a warrnig for such a case, for now.

by the way one of my publish failed badly: https://jsr.io/status/cc29f358-14fa-4bfe-9150-0df3f7374e37

V 1.0.12 can not be yank nor deleted.

UrielCh commented 4 months ago

Screenshot 2024-07-18 at 21 23 47

Screenshot 2024-07-18 at 21 24 27

4k vs 4K ... arf

dsherret commented 4 months ago

Deno should give a descriptive error about what's going on to help people out, so I'd rather keep this open.