Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json:exports: include leading ./ #560

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

dilyanpalauzov
Copy link
Contributor

https://nodejs.org/api/packages.html#exports contains «All paths defined in the "exports" must be relative file URLs starting with ./

Without leading ./ on "import"-ing ical.js NodeJS prints:

node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "dist/ical.min.js" defined in the package config some_path/node_modules/ical.js/package.json imported from some_path/src/zzz.js; targets must start with "./"
    at new NodeError (node:internal/errors:393:5)
    at throwInvalidPackageTarget (node:internal/modules/esm/resolve:386:9)
    at resolvePackageTargetString (node:internal/modules/esm/resolve:429:5)
    at resolvePackageTarget (node:internal/modules/esm/resolve:493:12)
    at resolvePackageTarget (node:internal/modules/esm/resolve:542:31)
    at packageExportsResolve (node:internal/modules/esm/resolve:606:27)
    at packageResolve (node:internal/modules/esm/resolve:843:14)
    at moduleResolve (node:internal/modules/esm/resolve:909:20)
    at defaultResolve (node:internal/modules/esm/resolve:1124:11)
    at nextResolve (node:internal/modules/esm/loader:163:28) {
  code: 'ERR_INVALID_PACKAGE_TARGET'
}

Node.js v18.12.0

https://nodejs.org/api/packages.html#exports contains «All paths defined
in the "exports" must be relative file URLs starting with "./" .»
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3571834483

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.138%

Totals Coverage Status
Change from base Build 3275454147: 0.0%
Covered Lines: 9199
Relevant Lines: 9358

💛 - Coveralls

dilyanpalauzov added a commit to dilyanpalauzov/ical.js that referenced this pull request Nov 29, 2022
kewisch#560

https://nodejs.org/api/packages.html#exports contains «All paths defined
in the "exports" must be relative file URLs starting with "./" .»
Copy link
Owner

@kewisch kewisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, much appreciated!

@kewisch kewisch merged commit 70d4250 into kewisch:main Jun 8, 2023
@dilyanpalauzov dilyanpalauzov deleted the exports_dot branch June 13, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants