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

Error while following getting started docs #41

Open
muddlebee opened this issue Jan 13, 2025 · 4 comments
Open

Error while following getting started docs #41

muddlebee opened this issue Jan 13, 2025 · 4 comments

Comments

@muddlebee
Copy link

muddlebee commented Jan 13, 2025

npx papi add dot -n polkadot

from https://papi.how/getting-started

getting error for above

$ npx papi add dot -n polkadot
Replacing existing dot config
✔ Metadata saved as .papi\metadata\dot.scale
Saved new spec "dot"
Reading metadata
Generating descriptors
CLI Building entry: .papi/descriptors/src/index.ts
C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\load-tsconfig\dist\index.cjs:174
  if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) {
                 ^

TypeError: Cannot read properties of undefined (reading 'compilerOptions')
    at loadTsConfigInternal (C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\load-tsconfig\dist\index.cjs:174:18)
    at loadTsConfig (C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\load-tsconfig\dist\index.cjs:209:35)
    at normalizeOptions (C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\tsup\dist\index.js:1452:48)
    at async C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\tsup\dist\index.js:1494:25
    at async Promise.all (index 0)
    at async Object.build (C:\Users\91824\Documents\Codes\swush-me\papi\node_modules\tsup\dist\index.js:1490:3)
    at async compileCodegen (file:///C:/Users/91824/Documents/Codes/swush-me/papi/node_modules/@polkadot-api/cli/dist/chunk-C4LGGIRP.js:466:3)
    at async generate (file:///C:/Users/91824/Documents/Codes/swush-me/papi/node_modules/@polkadot-api/cli/dist/chunk-C4LGGIRP.js:310:3)

Node.js v20.17.0
@muddlebee
Copy link
Author

okay so need to add a tsconfig.json in a new project

@voliva
Copy link
Contributor

voliva commented Jan 13, 2025

I'm reopening this - It's a small issue but I think we should support JS-only projects as well, so we either need to fix this or at least document it.

Thanks for reporting!

@voliva voliva reopened this Jan 13, 2025
@voliva
Copy link
Contributor

voliva commented Jan 14, 2025

I tried different package managers and versions and I couldn't reproduce it. Here's an example of a project with no tsconfig.json:
image

Can you give more details on your environment? package manager + version, papi version, etc. Maybe installed tsup version too, maybe you have duplicated versions?

@muddlebee
Copy link
Author

muddlebee commented Jan 14, 2025

npm -v
10.8.2

tsc --v
Version 5.6.3

node -v
v20.17.0

OS : Windows 11

latest version of Papi

Steps I followed for my local node

  • npm init
  • npm i polkadot-api
  • npx papi add dot -n polkadot (ERROR here)

@muddlebee muddlebee changed the title Error whie following getting started docs Error while following getting started docs Jan 20, 2025
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

No branches or pull requests

2 participants