Skip to content

ts-loader issue with exported types #1

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

Open
panManfredini opened this issue Oct 25, 2020 · 1 comment
Open

ts-loader issue with exported types #1

panManfredini opened this issue Oct 25, 2020 · 1 comment

Comments

@panManfredini
Copy link
Owner

panManfredini commented Oct 25, 2020

Somehow ts-loader does not manage to find types of interfaces like effectAPI and ExtendedlitElement.
If I compile with just tsc it works.

Error:

TS2305: Module '"../../../lit-element-effector"' has no exported member 'effectAPI'.

Seems like related to the fact that ts-loader needs a declaration file .d.ts. Tried to do that but not able because of this issue.

Maybe the solution in this issue here can also help.

Solution for now: If you really need these interfaces like effectAPI and ExtendedlitElement you can do:

  • Don't import the interfaces, just copy them in your code, they are defined here and here
  • Or compile in two steps, first only typescript (tsc) and then webpack.
  • Or use rollup with its typescript loader
@panManfredini
Copy link
Owner Author

Very weird thing is:

  • copy src/index.ts into index.d.ts
  • point typings in package.json to index.d.ts

Like this webpack+ts-loader magically compiles. Obviously tsc does not since index.d.ts is not a declaration file done like that...

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

1 participant