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: Note that you need plugins to import files that are not JavaScript #96

Closed
nonara opened this issue May 22, 2020 · 3 comments
Closed

Comments

@nonara
Copy link

nonara commented May 22, 2020

This error happens whenever trying to use dts() in a project which has a tsconfig.json file with "noEmit": true, specified.

Possible related to rollup/plugins#287

@Swatinem
Copy link
Owner

Hm, we possibly have to override that option here:

const OPTIONS_OVERRIDE: ts.CompilerOptions = {
// Ensure ".d.ts" modules are generated
declaration: true,
// Skip ".js" generation
emitDeclarationOnly: true,
// Skip code generation when error occurs
noEmitOnError: true,
// Avoid extra work
checkJs: false,
declarationMap: false,
skipLibCheck: true,
// Ensure TS2742 errors are visible
preserveSymlinks: true,
// Ensure we can parse the latest code
target: ts.ScriptTarget.ESNext,
};

Can you give a more detailed example? I suspect you are using the plugin with .ts files?

@nonara
Copy link
Author

nonara commented May 24, 2020

That did the trick. Thanks 😄

@castarco
Copy link
Contributor

castarco commented Aug 4, 2024

I don't think this is truly solved. Having the most simple configuration, just because I use import mapping... it crashes, even though:

  • I specified the paths in package.json's imports field
  • I also specified the paths in tsconfig.json's compilerOptions.paths field.
  • I passed these same paths to the plugin options.

I mean, one would think that rollup-plugin-dts is supposed to read TypeScript; in case there is a mistake on user's side... maybe the problem is in the message error rather than on the fact that it raises an error?

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

3 participants