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

Broken NPM package #1403

Closed
tunnckoCore opened this issue Nov 29, 2023 · 5 comments · Fixed by #1413
Closed

Broken NPM package #1403

tunnckoCore opened this issue Nov 29, 2023 · 5 comments · Fixed by #1413

Comments

@tunnckoCore
Copy link

Hey there.

Seems like the exports definitions are broken, the build system or whatever generates cjs/src/index.js and in the package.json everything is without the src/ Putting it back fixes my problem of now been able to load it on graphql-yoga.

  "main": "cjs/src/index.js",
  "module": "esm/src/index.js",
  "typings": "typings/src/index.d.ts",
  "typescript": {
    "definition": "typings/src/index.d.ts"
  },
  "type": "module",
  "exports": {
    ".": {
      "require": {
        "types": "./typings/src/index.d.cts",
        "default": "./cjs/src/index.js"
      },
      "import": {
        "types": "./typings/src/index.d.ts",
        "default": "./esm/src/index.js"
      },
      "default": {
        "types": "./typings/src/index.d.ts",
        "default": "./esm/src/index.js"
      }
    },
    "./package.json": "./package.json"
  }
@ardatan
Copy link
Collaborator

ardatan commented Nov 29, 2023

I don't see "src" when I checked the published package code here. Are you sure you are using the latest version?
https://www.npmjs.com/package/sofa-api?activeTab=code

@josephj
Copy link

josephj commented Nov 29, 2023

Yea I got the same issue. Thank you @tunnckoCore for reporting this.

The following error happens in the runtime. I think it wasn't built properly before publishing to npm.

CleanShot 2023-11-30 at 09 31 52@2x

@josephj
Copy link

josephj commented Nov 30, 2023

@ardatan

I don't see "src" when I checked the published package code here. Are you sure you are using the latest version?

I guess this is probably the misunderstanding from @tunnckoCore's description (He addes the src for fixing) The following is what I get without manual fixing.

CleanShot 2023-11-30 at 12 34 19@2x

@josephj
Copy link

josephj commented Nov 30, 2023

It works well after I use the fixed 0.18.0 version.

@Axum666
Copy link

Axum666 commented Dec 4, 2023

also getting the same thing when trying to upgrade from 18.0 to 18.1

image

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 a pull request may close this issue.

4 participants