-
Notifications
You must be signed in to change notification settings - Fork 20
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
bio-parsers npm package lacks the "type": "module" decalration, cannot be used on backend #107
Comments
I get this without the addition to type: module in package json of the bio-parsers module: (node:21648) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. SyntaxError: Unexpected token 'export' Node.js v20.11.1 |
@V3rt3Xk3 would you like to make a pull request with your suggested code changes? Thanks! |
Hi @tnrich , I am very new to both typescript and open source. I would be delighted if I could join in maintaining this gem, but i might need to guiding thoughts, please see below. Thank you for believing in me! :) I will try to approach the issue from the DevOps point of view. I have been playing with the fork, i might need to refork it again though, and start playing on separate branches. I will look into what i can do about it on the weekend. I have made a fix but the typescript part needed to be hacked into the package i published with your infrastructure. Can you maybe give me a hint or steps on how you exactly publish now? The tsc does not seem to put the exports into the correct place. It is saying that the typescript types and artifacts are being emitted outside of my repository. I might be even able to share a publish log with you. I would be happy if you could summarize the publish procedure to one of the packages that actually results in the typescript files emitted into the package itself. My attempts excluded the ts artifacts. PS: I followed the documentation on the repository. All the best |
Hi @V3rt3Xk3 without looking at the code it is hard for me to diagnose what is going wrong or what you're trying to do exactly. Is the repo you're working in open source? If so can you link it here? |
@tnrich
Hi, thank you for your work!!!
I was unable to import the genbank to json parser. In the github repositorythe code is correct, but the npm package lacks the type setting.
Fixed packages.json, now i can import the
import {genbankToJson} from '@teselagen/bio-parsers';
{
"type": "module",
"name": "@teselagen/bio-parsers",
"version": "0.4.22",
"dependencies": {
"@teselagen/sequence-utils": "0.3.27",
"@teselagen/range-utils": "0.3.7",
"@gmod/gff": "^1.2.1",
"buffer": "^6.0.3",
"bufferpack": "^0.0.6",
"color": "^4.2.3",
"fast-xml-parser": "^4.2.5",
"fflate": "^0.8.0",
"lodash-es": "^4.17.21",
"string_decoder": "^1.3.0",
"validate.io-nonnegative-integer-array": "^1.0.1"
},
"license": "MIT"
}
Original packages.json (missing type declaration)
{
"name": "@teselagen/bio-parsers",
"version": "0.4.22",
"dependencies": {
"@teselagen/sequence-utils": "0.3.27",
"@teselagen/range-utils": "0.3.7",
"@gmod/gff": "^1.2.1",
"buffer": "^6.0.3",
"bufferpack": "^0.0.6",
"color": "^4.2.3",
"fast-xml-parser": "^4.2.5",
"fflate": "^0.8.0",
"lodash-es": "^4.17.21",
"string_decoder": "^1.3.0",
"validate.io-nonnegative-integer-array": "^1.0.1"
},
"license": "MIT"
}
The "type": "module" is missing. I am new to typescript but without this I was not able to use your code on backend. (Node20, typescript)
My import was always complaining about syntax errors regarding an unexpected token: export.
Also I have installed the package with this npm command: npm install -S @teselagen/bio-parsers
Also if it like this by design then please let me know and I do a fork :), thanks
The text was updated successfully, but these errors were encountered: