enhance-dev / fastify-plugin

Build your Fastify app's views with custom elements. Powered by Enhance
https://enhance.dev/docs/learn/deployment/fastify
3 stars 0 forks source link

Error in package exports #3

Open sdussaut opened 1 year ago

sdussaut commented 1 year ago

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:

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.<anonymous> (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!

tbeseda commented 1 year ago

Hi @sdussaut thanks for reporting The Fastify plugin definitely needs a look, it hasn't kept up with mainline Enhance where things move a bit faster lately. I'll jump on it this Friday or early next week.