Closed mattcroat closed 2 years ago
Did you ever make progress on this?
This is odd, because exports
is only for commonjs
node-dominos is ES2017+ ESM and uses export
not the old exports
method.
export {
urls as default,
urls,
canada,
usa,
useInternational
}
I'm using Node v15.2.1.
Using imports from
dominos/utils/urls.js
throws an error.The solution might be adding the subpath under the package entry points defined in
package.json
.Output
```sh node:internal/process/esm_loader:74 internalBinding('errors').triggerUncaughtException( ^ Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './utils/urls.js' is not defined by "exports" in /home/user/dominos/node_modules/dominos/package.json imported from /home/user/dominos/index.js at new NodeError (node:internal/errors:277:15) at throwExportsNotFound (node:internal/modules/esm/resolve:321:9) at packageExportsResolve (node:internal/modules/esm/resolve:546:3) at packageResolve (node:internal/modules/esm/resolve:687:14) at moduleResolve (node:internal/modules/esm/resolve:739:18) at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:853:11) at Loader.resolve (node:internal/modules/esm/loader:85:40) at Loader.getModuleJob (node:internal/modules/esm/loader:229:28) at ModuleWrap.