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.

No matching export for import typescript interface

See original GitHub issue

Describe the bug

Uncaught SyntaxError: The requested module ‘/app.ts’ does not provide an export named ‘Test’

Reproduction

https://github.com/lake2/vite_bug

System Info

  • vite version: 2
  • Operating System: mac
  • Node version: v15.5.0
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wolfzwzcommented, Apr 9, 2021

This is a wontfix because esbuild transforms files in isolation. If you really want this behavior you need to disable esbuild and use something like @rollup/plugin-typescript. Another way: a.js

export defalut interface list {}

b.js It can be quoted like this

import {defalut as list} from 'a.js'
1reaction
patak-devcommented, Mar 22, 2021

There is a know issue in Vue with type imports, it should work if you use the import type form

import type { User } from '~/types'

@pingustar let’s avoid commenting on old issues, your question may end up being ignored. Please start a GitHub Discussion or join the chat at Vite Land to ask questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot export/import interfaces in Typescript - Stack Overflow
Save this question. Show activity on this post. Same error shows if I try to export a Type but it works fine if...
Read more >
Documentation - Modules - TypeScript
Often modules extend other modules, and partially expose some of their features. A re-export does not import it locally, or introduce a local...
Read more >
Module has no default export Error in TypeScript | bobbyhadz
The "Module has no default export" error occurs when we try to import as default from a module that doesn't have a default...
Read more >
Common Error Details - Snowpack
If you are using TypeScript, this error could occur if you are importing or exporting something that only exists in TypeScript (like a...
Read more >
Content Types - ESBuild
exports = fn , you need to use import fn from 'path' instead of import * as fn from 'path' . #Features that...
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