Skip to content

Webpack error: "Module not found: Error: Package path . is not exported from package" #749

@keysmusician

Description

@keysmusician

Describe the bug

Using this package with Webpack (5.95.0) is throwing the following error:

Module not found: Error: Package path . is not exported from package //node_modules/@solid-primitives/deep (see exports field in //node_modules/@solid-primitives/deep/package.json)

I am able to resolve the issue by changing the "exports" field in @solid-primitives/deep/package.json from this:

...
  "exports": {
    "@solid-primitives/source": "./src/index.ts",
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
...

to this:

...
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
...

Minimal Reproduction Link

https://github.com/keysmusician/webpack-error-demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions