enhance-dev / enhance-dev/fastify-plugin

Error in package exports

Open
#3 1 comment 0 reactions 1 assignee Claimed by @tbeseda View on GitHub
Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi there!

I tried the fastify example on https://enhance.dev/docs/learn/deployment/fastify and getting a package export error from the arc-plugin-enhance package.

Here is the error I am getting:

```shell
node:internal/errors:464
ErrorCaptureStackTrace(err);
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/http/any-catchall/index.mjs' is not defined by "exports" in /node_modules/@enhance/arc-plugin-enhance/package.json imported from /node_modules/@enhance/fastify-plugin/index.mjs
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at packageResolve (node:internal/modules/esm/resolve:873:14)
at moduleResolve (node:internal/modules/esm/resolve:929:18)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
```

I kind of fixed it locally by adding `"./src/http/any-catchall/index.mjs": "./src/http/any-catchall/index.mjs"` to the `exports` entry in the package.json file but wondered if this is the best way to do this?

Anyway, I am having a really good time playing with enhance! Nice work!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.