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.

Is not a module error

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform:
  • Vetur version: 0.24.0
  • VS Code version: 1.43.0-insider

Problem

In a TypeScript CLI generated project (no Babel) the following import in “App.vue” reports a “not a module” error!

// File: App.vue
<script lang="ts">
import HelloWorld from "./components/HelloWorld/HelloWorld.vue";

Error: “HelloWorld.vue is not a module”

Project builds and runs fine, but Vetur fails to determine the file is a module.

The file “HelloWorld.vue” file contains.

<template>
  <div>
    <h1>Hello World!</h1>
  </div>
</template>

<script lang="ts" src="./HelloWorld.ts" />
<style scoped lang="stylus" src="./HelloWorld.stylus" />

vetur

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
MrTomekcommented, Apr 25, 2020

Temporary solution. Add a ruler before error this comment

// @ts-ignore
1reaction
octrefcommented, Jul 30, 2020

Duplicate of #1187, which will be fixed soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript ES6 import module "File is not a module error"
When I am trying to compile the main.ts file I get this error: Error TS2306: File 'test.ts' is not a module. How can...
Read more >
TypeScript ES6 import module File is not a module error
I am using TypeScript 1.6 with ES6 modules syntax. My files are: test.ts: module App { export ... ' is not a module....
Read more >
File is not a module error in TypeScript | bobbyhadz
The error "File is not a module" simply means that the file does not contain any export or import statements. Any file that...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
When you try to import a module in a Python file, Python tries to resolve this module in several ways. · As the...
Read more >
Typescript es6 import module “File is not a module error”
Javascript – Typescript es6 import module “File is not a module error”. ecmascript-6javascripttypescript. I am using typescript 1.6 with es6 modules syntax.
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