plugins/karma.d.ts is not a module
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.2.7
node: 6.11.2
os: linux x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.2.7
@angular/compiler-cli: 4.3.3
@angular/language-service: 4.3.3
Repro steps.
Create new Angular CLI app and convert karma.conf.js to karma.conf.ts
Try to import @angular/cli/plugins/karma
with
import karmaAngularCli = require('@angular/cli/plugins/karma');
The log given by the failure.
...node_modules/@angular/cli/plugins/karma.d.ts is not a module
Desired functionality.
I’d like to import the Karma plugin this way in my karma.conf.ts because IntelliJ does not understand the use of require
in the plugins array.
plugins: [
...
// It wants to import 'require' from another file (./src/test).
require('@angular/cli/plugins/karma'),
],
Mention any other details that might be useful.
The file ..node_modules/@angular/cli/plugins/karma.d.ts
is completely empty, this might be why Typescript does not understand it.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
TypeScript typings give me "index.d.ts is not a module"
The index.d.ts file indeed is not a module, it just references two other files with interfaces in them. So I thought to remove...
Read more >heremaps index.d.ts is not a module - Budi Irawan
ts' is not a module. It is because heremaps is a browser library, but I'm using moduleResolution: "node" in my tsconfig.
Read more >Documentation - Modules .d.ts - TypeScript
Comparing JavaScript to an example DTS. Common CommonJS Patterns. A module using CommonJS patterns uses module.exports to describe the exported values.
Read more >File is not a module error in TypeScript | bobbyhadz
We used the export keyword to export the sum function. Now we can import it in the index.ts file.
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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If anyone else runs into this, what fixed it for me was to change
to
in karma.conf.js
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.