{"id":788,"hash":"63da3ef38d51392bb8501ff9669ed253212350b2a810f29b3bb6babdb81f2c35","pattern":"Export not found on module","full_message":"I have a library, in one of the files i export an interface:\n\nexport interface MyInterface {\n...\n}\n\nand there is a default export, which is a react component.\n\nOn an index.ts file, I import few stuff, and re-export them:\n\nimport Something from \"./Something\";\nimport OtherStuff from \"./OtherStuff\";\nimport ExportDefault, { MyInterface } from \"./QuestionFile\";\n\nexport { Something, OtherStuff, ExportDefault, MyInterface };\n\nWhen I compile, I get an error:\n\n  MyInterface is not exported by QuestionFile.\n\nMy goal is, whoever imports my library is able to import that type definition to use too.\n\nIs there a better way to do that?\n\nif I do:\n\nexport * from \"./QuestionFile\"\n\nit works, otherwise it breaks my build.\n\nAn example on what is going on can be found on this repository: https://github.com/PlayMa256/typescript-babel-error","ecosystem":"npm","package_name":"typescript","package_version":null,"solution":"Re-exporting types is one of the known TypeScript constructs that don't work when using Babel to compile TypeScript because they require cross-file information.  You can enable the isolatedModules TypeScript compiler option to report these constructs as errors when you compile with tsc (not Babel) or use the TypeScript language service in an IDE.  export * is one workaround; another described in this issue is to use a type alias instead of a re-export.  Yet another workaround is to merge a constant with the interface.  (It's a hack but avoids some of the disadvantages of the other approaches.)\n\nexport interface testInterface {\n    name?: string;\n}\nexport const testInterface = undefined;","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/52258061/export-not-found-on-module","votes":13,"created_at":"2026-04-19T04:51:43.003023+00:00","updated_at":"2026-04-19T04:51:43.003023+00:00"}