Skip to content

bug: [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './screenshot' is not defined by "exports" in …/node_modules/@stencil/core/package.json #5906

@ryuran

Description

@ryuran

Prerequisites

Stencil Version

>= v4.19.0

Current Behavior

If we set a screenshot cnnector like told by the documentation https://stenciljs.com/docs/screenshot-connector
When run test with screensot : stencil test --e2e --screenshot

This error appear

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './screenshot' is not defined by "exports" in …/node_modules/@stencil/core/package.json

Expected Behavior

Run screenshot test as before without this error message.

System Info

System: node 18.18.2
    Platform: darwin (23.5.0)
   CPU Model: Apple M1 Pro (10 cpus)
    Compiler: …/node_modules/@stencil/core/compiler/stencil.js
       Build: 1719938890
     Stencil: 4.19.2 🏉
  TypeScript: 5.4.5
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.31.1

Steps to Reproduce

Add a screenshot connector like the doc say https://stenciljs.com/docs/screenshot-connector#methods
Then run the command
run stencil test --e2e --screenshot

Code Reproduction URL

https://github.com/ryuran/stencil-bugs/tree/screeshot-export-bug

Additional Information

The connector try to import const { ScreenshotLocalConnector } = require('@stencil/core/screenshot'); but @stencil/core/screenshot is not exposed by @stencil/core package.json

Metadata

Metadata

Labels

Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions