question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't generate files for scoped packages

See original GitHub issue

I realize that @types/storybook__react exists, this problem is really about if I use private scoped packages.

npx dts-gen -m @storybook/react
Unexpected crash! Please log a bug with the commandline you specified.
ENOENT: no such file or directory, open '@storybook/react.d.ts'

if I make a directory for @storybook in my project and run the command I get

npx dts-gen -m @storybook/react
Wrote 3 lines to @storybook/react.d.ts.

which is just a file called react.d.ts inside the @storybook directory I created and has the following contents

/** Declaration file generated by dts-gen */

export = @storybook/react;

it seems to have an error

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:24
  • Comments:7

github_iconTop GitHub Comments

1reaction
siddthesquidcommented, Feb 9, 2022

I got this error for a third party scoped package. If it helps anyone, a quick and dirty workaround was to:

  1. Install your scoped package @org/package. It will show up under node_modules/@org/package
  2. Copy node_modules/@org/package to node_modules/package
  3. Run dts-gen -m package.
  4. Wrap the generated file with declare module @org/package
  5. Delete the node_modules/package folder which you no longer need.
1reaction
LawnGnomecommented, Oct 22, 2020

Did you find a solution to this?

No; this wasn’t on the critical path for the project I was working on, so I dropped it, and I no longer work at that company. Sorry!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not find local declaration file for scoped packages #23999
My testing seems to show that a local declaration file for a non-scoped package is found, but that one for a scoped package...
Read more >
Creating and publishing scoped public packages - npm Docs
To share your code publicly in a user or organization namespace, you can publish public user-scoped or organization-scoped packages to the npm registry....
Read more >
Can not install npm scoped package - Stack Overflow
My project uses private registry packages along with common packages. I setup my scope registry according to docs at ...
Read more >
Setting up a TypeScript multi-package mono-repo for ...
How to use NPM workspaces for scoped packages. ... For each package we create an index.ts file. // contents of ./packages/is-even/index.ts ...
Read more >
Scoped registry in package.json not working - Unity Forum
Attached Files: ... It will generate the mantifest.json like below, ... If a registry is scoped within the package.json, you shouldn't have ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found