Skip to content

bug in npm resolution #20

@nestarz

Description

@nestarz
import { ResolutionMode, Workspace } from "jsr:@deno/loader";

const workspace = new Workspace({
  noConfig: true,
});
const loader = await workspace.createLoader({
  entrypoints: ["npm:react-remove-scroll-bar"],
});
loader.resolve(
  "npm:react-remove-scroll-bar/constants",
  undefined,
  ResolutionMode.Require,
);
error: Uncaught (in promise) Error: [ERR_MODULE_NOT_FOUND] Cannot find module 'file:///Users/x/Library/Caches/deno/npm/registry.npmjs.org/react-remove-scroll-bar/2.3.8/constants/index.js' imported from 'file:///Users/x/code/test-rolldown-deno/bug-loader'

@deno/loader seems to not work with some npm specifiers. It seems not respecting the package.json in react-remove-scroll-bar/2.3.8/constants/package.json:

{
  "description": "separate entrypoint for constants only",
  "private": true,
  "main": "../dist/es5/constants.js",
  "jsnext:main": "../dist/es2015/constants.js",
  "module": "../dist/es2015/constants.js",
  "sideEffects": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions