-
-
Notifications
You must be signed in to change notification settings - Fork 593
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: [type] is not exported by [file] #71
Comments
Hey folks (this is a canned reply, but we mean it!). Thanks to everyone who participated in this issue. We're getting ready to move this plugin to a new home at https://github.com/rollup/plugins, and we have to do some spring cleaning of the issues to make that happen. We're going to close this one, but it doesn't mean that it's not still valid. We've got some time yet before the move while we resolve pending Pull Requests, so if this issue is still relevant, please @ me and I'll make sure it gets transferred to the new repo. 🍺 |
Thanks for responding! I think that this issue is still relevant @shellscape. I would be glad to know that it will be transferred to the new repo. |
Hi, is this fixed or not? |
It's not fixed yet, it's just been transferred to the new repository. |
There is a workaround for this, I'll be it is not an ideal one, but it is what I have been using in the meantime. Instead of import { Type1, Type2 } from './file.ts';
export {
Type2
}
export const fn1: Type1 = () => {
// ...
} I just import { Type1, Type2 } from './file';
export const fn1: Type1 = () => {
// ...
}
export * from './file'; The only problem with this is that I do not really want to export |
I just realized that this is a duplicate of rollup/rollup-plugin-typescript#28. Sorry for the inconvenience. |
Well. You are referring to a issue in old repository and it was closed due to repository move. However this is not resolved right now. For me the workaround is not acceptable because I have a very large code base. |
@ziofat if you'd like to put together a minimal reproduction in a repo that we can clone, I'd be happy to reopen this. We're going to need a reproduction to triage this. |
@shellscape OK, I will try to make a reproduction later. |
I created a repo that reproduces the issue here https://github.com/PeteJodo/repro-rollup-typescript-export-type-issue I get this output
|
Yes, I have the same issue and temporary not exporting the props of my React components due to this issue. I have also tried |
I'll try to get this working with our larger TS plugin updates. |
This is fixed with @rollup/plugin-typescript version 3.0.0! |
|
Can we reopen? I'm still receiving this error when using Babel to compile TypeScript and importing types from third-party libs in |
@earksiinni you're welcome to open a new issue with a proper reproduction. We won't be reopening this one. |
Exporting the type explicitly did not work for me (I was getting errors that ExampleComponent did not export a Prop type, even when it did). The workaround specified here worked for me: rollup/plugins#71 (comment)
Solved this issue by doing the following: import { TypeYouWantToExport as TypeYouWantToExportReal } from './file1'
export type TypeYouWantToExport = TypeYouWantToExportReal |
For desperate googlers: I'm a total rollup/typescript noob but I fixed it for myself with https://www.typescriptlang.org/docs/handbook/modules.html#importing-types |
This worked for me too (import type) but it does seem like a workaround. |
this resolved my concern, hope it helps
|
Hi, i had similar issue but with react-beautiful-dnd. It helped to |
This also fails with |
Running into this with Nuxt 3.0.0-rc.4 when trying to import from a library, while it was previously working |
I ran into this issue when trying to use an enum that was exported by the library's typedef but which wasn't exported in the library's es6 module. There was no help from the compiler until switching from |
@thorsent the suggestion to |
In my case I was importing an // ...
export default defineConfig({
build: {
rollupOptions: {
external: ['@project/library'],
},
},
// ...
}) |
this worked for me! |
Having same issue when I build in Vite. All my interfaces get the import/export error |
(This issue was transferred from rollup-plugin-typescript and had no issue template)
This code:
Throws this error in the console:
Is there any workaround or fix for this?
The text was updated successfully, but these errors were encountered: