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

importing sandbag in openbeta-graphql is broken #123

Closed
musoke opened this issue Jun 19, 2023 · 1 comment · Fixed by #129
Closed

importing sandbag in openbeta-graphql is broken #123

musoke opened this issue Jun 19, 2023 · 1 comment · Fixed by #129
Labels
bug Something isn't working regression Something that used to work is broken
Milestone

Comments

@musoke
Copy link
Collaborator

musoke commented Jun 19, 2023

It looks like we have a regression introduced sometime in the last few weeks.

I am running into some strange errors while trying to update the version of sandbag used by openbeta-graphql, so we can use the new scales people have added recently. All I did was change the version of sandbag in openbeta-graphql's package.json to ^0.0.42. Then I get errors like

 FAIL  build/__tests__/gradeUtils.js
   ● Test suite failed to run

       SyntaxError: The requested module '@openbeta/sandbag' does not provide an export named 'GradeScales'

             at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:808:5)

             Test Suites: 17 failed, 17 total

git bisect indicates that the regression entered in e4fbbd0 , which didn't change any exports.

@actuallyyun, do you have any ideas?

@musoke musoke added bug Something isn't working regression Something that used to work is broken labels Jun 19, 2023
@musoke musoke added this to the M10 milestone Jun 19, 2023
@musoke
Copy link
Collaborator Author

musoke commented Jun 20, 2023

The offending line seems to be

"type": "module"

The change to a module was to enable running the csvtojson script more easily. Integrating that as in #121 would remove the need for this.

musoke added a commit to musoke/sandbag that referenced this issue Jun 27, 2023
e4fbbd0 added `"typde": "module"` to
`package.json`.  This broke importing of sandbag in openbeta-graphql.

package.json also needs an exports field, telling it which modules are
exposed for export.  Add it.

Also update to typescript ^4.9.5, a version which supports
`package.json` exports.  See
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

Fixes OpenBeta#123
@musoke musoke changed the title imports to openbeta-graphql broken importing sandbag in openbeta-graphql is broken Jun 27, 2023
musoke added a commit that referenced this issue Jun 27, 2023
e4fbbd0 added `"typde": "module"` to
`package.json`.  This broke importing of sandbag in openbeta-graphql.

package.json also needs an exports field, telling it which modules are
exposed for export.  Add it.

Also update to typescript ^4.9.5, a version which supports
`package.json` exports.  See
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

Fixes #123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something that used to work is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant