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

Fix invalid exports #53

Merged
merged 1 commit into from Dec 28, 2022
Merged

Fix invalid exports #53

merged 1 commit into from Dec 28, 2022

Conversation

Polarisation
Copy link
Contributor

What was changed

The exports in package.json has been updated to a valid format. They just needed to start with ./

Why?

Using Next.js + TypeScript + Node.js 16, could not build because the exports in package.json were invalid.

> Build error occurred
Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" target "dist/SegmentedControlWithoutStyles.js" defined for './SegmentedControlWithoutStyles' in the package config node_modules/segmented-control/package.json; targets must start with "./"
    at new NodeError (node:internal/errors:363:5)
    at throwInvalidPackageTarget (node:internal/modules/esm/resolve:340:9)
    at resolvePackageTargetString (node:internal/modules/esm/resolve:368:5)
    at resolvePackageTarget (node:internal/modules/esm/resolve:405:12)
    at packageExportsResolve (node:internal/modules/esm/resolve:506:22)
    at resolveExports (node:internal/modules/cjs/loader:478:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:518:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:27)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Module.require (node:internal/modules/cjs/loader:1013:19) {
  type: 'Error',
  code: 'ERR_INVALID_PACKAGE_TARGET'

Checklist

  1. How was this tested:

Against a private Next.js + TypeScript + Node.js 16 project.

  1. Any docs updates needed?

No

@lorensr lorensr merged commit 70a1f24 into lorensr:master Dec 28, 2022
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.

None yet

2 participants